woden_uri_attr.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef WODEN_URI_ATTR_H
00019 #define WODEN_URI_ATTR_H
00020 
00027 #include <woden.h>
00028 #include <axis2_uri.h>
00029 #include <woden_xml_attr.h>
00030 
00036 typedef struct woden_uri_attr woden_uri_attr_t;
00037 typedef struct woden_uri_attr_ops woden_uri_attr_ops_t;
00038 struct axiom_element;
00039 struct axiom_node;
00040 
00041 #ifdef __cplusplus
00042 extern "C"
00043 {
00044 #endif
00045 
00046 struct woden_uri_attr_ops
00047 {
00052     axis2_status_t (AXIS2_CALL *
00053     free) (
00054             void *uri_attr,
00055             const axis2_env_t *env);
00056     
00057     axis2_status_t (AXIS2_CALL *
00058     to_uri_attr_free) (
00059             void *uri_attr,
00060             const axis2_env_t *env);
00061     
00062     woden_obj_types_t (AXIS2_CALL *
00063     type) (
00064             void *uri_attr,
00065             const axis2_env_t *env);
00066 
00070     woden_xml_attr_t *(AXIS2_CALL *
00071     get_base_impl) (
00072             void *uri_attr,
00073             const axis2_env_t *env);
00074 
00075     /* ************************************************************
00076      *  QNameAttr interface declared methods 
00077      * ************************************************************/
00078 
00079     axis2_uri_t *(AXIS2_CALL *
00080     get_uri) (
00081             void *uri_attr,
00082             const axis2_env_t *env);
00083 
00084     /* ************************************************************
00085      *  Non-API implementation methods 
00086      * ************************************************************/
00087     
00088     /*
00089      * Convert a string of type xs:anyURI to a axis2_uri_t.
00090      * An empty string argument will return an empty string URI.
00091      * A null argument will return a null value.
00092      * Any conversion error will be reported and a null value will be returned.
00093      */
00094     void *(AXIS2_CALL *
00095     convert) (
00096             void *uri_attr,
00097             const axis2_env_t *env,
00098             struct axiom_element *owner_el,
00099             struct axiom_node *owner_node,
00100             axis2_char_t *attr_value);
00101 
00102   
00103 };
00104 
00105 struct woden_uri_attr
00106 {
00107     woden_xml_attr_t base;
00108     woden_uri_attr_ops_t *ops;
00109 };
00110 
00111 /*
00112  * TODO This constructor is not used for extension attributes, but may be useful if
00113  * parsing of native WSDL attributes is changed to use the XMLAttr interface.
00114  */
00115 AXIS2_EXTERN woden_uri_attr_t * AXIS2_CALL
00116 woden_uri_attr_create(
00117         const axis2_env_t *env,
00118         struct axiom_element *owner_el,
00119         struct axiom_node *owner_node,
00120         axis2_qname_t *attr_type,
00121         axis2_char_t *attr_value);
00122 
00123 
00124 /************************Woden C Internal Methods******************************/
00125 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00126 woden_uri_attr_resolve_methods(
00127         woden_uri_attr_t *uri_attr,
00128         const axis2_env_t *env,
00129         axis2_hash_t *methods);
00130 /************************End of Woden C Internal Methods***********************/
00131 
00132 #define WODEN_URI_ATTR_FREE(uri_attr, env) \
00133       (((woden_uri_attr_t *) uri_attr)->ops->free(uri_attr, env))
00134 
00135 #define WODEN_URI_ATTR_TO_URI_ATTR_FREE(uri_attr, env) \
00136       (((woden_uri_attr_t *) uri_attr)->ops->\
00137          to_uri_attr_free(uri_attr, env))
00138 
00139 #define WODEN_URI_ATTR_TYPE(uri_attr, env) \
00140       (((woden_uri_attr_t *) uri_attr)->ops->type(uri_attr, env))
00141 
00142 #define WODEN_URI_ATTR_GET_BASE_IMPL(uri_attr, env) \
00143       (((woden_uri_attr_t *) uri_attr)->ops->get_base_impl(uri_attr, \
00144                                                                         env))
00145 
00146 #define WODEN_URI_ATTR_GET_URI(uri_attr, env) \
00147       (((woden_uri_attr_t *) uri_attr)->ops->get_uri(uri_attr, \
00148                                                                     env))
00149 
00150 #define WODEN_URI_ATTR_CONVERT(uri_attr, env) \
00151       (((woden_uri_attr_t *) uri_attr)->ops->convert(uri_attr, \
00152                                                                        env))
00153 
00155 #ifdef __cplusplus
00156 }
00157 #endif
00158 #endif /* WODEN_URI_ATTR_H */

Generated on Wed Dec 20 20:34:50 2006 for Axis2/C by  doxygen 1.5.1