woden_uri_attr.h

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

Generated on Thu Oct 26 21:00:12 2006 for Axis2/C by  doxygen 1.4.7