woden_qname_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_QNAME_ATTR_H
00018 #define WODEN_QNAME_ATTR_H
00019 
00026 #include <woden.h>
00027 #include <woden_xml_attr.h>
00028 
00034 typedef struct woden_qname_attr woden_qname_attr_t;
00035 typedef struct woden_qname_attr_ops woden_qname_attr_ops_t;
00036 struct axiom_element;
00037 struct axiom_node;
00038 
00039 #ifdef __cplusplus
00040 extern "C"
00041 {
00042 #endif
00043 
00044 struct woden_qname_attr_ops
00045 {
00050     axis2_status_t (AXIS2_CALL *
00051     free) (
00052             void *qname_attr,
00053             const axis2_env_t *env);
00054     
00055     axis2_status_t (AXIS2_CALL *
00056     to_qname_attr_free) (
00057             void *qname_attr,
00058             const axis2_env_t *env);
00059     
00060     woden_obj_types_t (AXIS2_CALL *
00061     type) (
00062             void *qname_attr,
00063             const axis2_env_t *env);
00064 
00068     woden_xml_attr_t *(AXIS2_CALL *
00069     get_base_impl) (
00070             void *qname_attr,
00071             const axis2_env_t *env);
00072 
00073     /* ************************************************************
00074      *  QNameAttr interface declared methods 
00075      * ************************************************************/
00076 
00077     axis2_qname_t *(AXIS2_CALL *
00078     get_qname) (
00079             void *qname_attr,
00080             const axis2_env_t *env);
00081 
00082     /* ************************************************************
00083      *  Non-API implementation methods 
00084      * ************************************************************/
00085 
00086     /*
00087      * Convert a string of type xs:QName to a axis2_qname_t.
00088      * A a null argument will return a null value.
00089      * Any conversion error will be reported and a null value will be returned.
00090      */
00091     void *(AXIS2_CALL *
00092     convert) (
00093             void *qname_attr,
00094             const axis2_env_t *env,
00095             struct axiom_element *owner_el,
00096             struct axiom_node *owner_node,
00097             axis2_char_t *attr_value);
00098 
00099   
00100 };
00101 
00102 struct woden_qname_attr
00103 {
00104     woden_xml_attr_t base;
00105     woden_qname_attr_ops_t *ops;
00106 };
00107 
00108 /*
00109  * TODO This constructor is not used for extension attributes, but may be useful if
00110  * parsing of native WSDL attributes is changed to use the XMLAttr interface.
00111  */
00112 AXIS2_EXTERN woden_qname_attr_t * AXIS2_CALL
00113 woden_qname_attr_create(
00114         const axis2_env_t *env,
00115         struct axiom_element *owner_el,
00116         struct axiom_node *owner_node,
00117         axis2_qname_t *attr_type,
00118         axis2_char_t *attr_value);
00119 
00120 
00121 /************************Woden C Internal Methods******************************/
00122 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00123 woden_qname_attr_resolve_methods(
00124         woden_qname_attr_t *qname_attr,
00125         const axis2_env_t *env,
00126         axis2_hash_t *methods);
00127 /************************End of Woden C Internal Methods***********************/
00128 
00129 #define WODEN_QNAME_ATTR_FREE(qname_attr, env) \
00130       (((woden_qname_attr_t *) qname_attr)->ops->free(qname_attr, env))
00131 
00132 #define WODEN_QNAME_ATTR_TO_QNAME_ATTR_FREE(qname_attr, env) \
00133       (((woden_qname_attr_t *) qname_attr)->ops->\
00134          to_qname_attr_free(qname_attr, env))
00135 
00136 #define WODEN_QNAME_ATTR_TYPE(qname_attr, env) \
00137       (((woden_qname_attr_t *) qname_attr)->ops->type(qname_attr, env))
00138 
00139 #define WODEN_QNAME_ATTR_GET_BASE_IMPL(qname_attr, env) \
00140       (((woden_qname_attr_t *) qname_attr)->ops->get_base_impl(qname_attr, \
00141                                                                         env))
00142 
00143 #define WODEN_QNAME_ATTR_GET_QNAME(qname_attr, env) \
00144       (((woden_qname_attr_t *) qname_attr)->ops->get_qname(qname_attr, \
00145                                                                     env))
00146 
00147 #define WODEN_QNAME_ATTR_CONVERT(qname_attr, env) \
00148       (((woden_qname_attr_t *) qname_attr)->ops->convert(qname_attr, \
00149                                                                        env))
00150 
00152 #ifdef __cplusplus
00153 }
00154 #endif
00155 #endif /* WODEN_QNAME_ATTR_H */

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