woden_qname_or_token_any_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_OR_TOKEN_ANY_ATTR_H
00018 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_H
00019 
00028 #include <woden.h>
00029 #include <woden_xml_attr.h>
00030 #include <axis2_array_list.h>
00031 
00037 typedef struct woden_qname_or_token_any_attr 
00038         woden_qname_or_token_any_attr_t;
00039 typedef struct woden_qname_or_token_any_attr_ops 
00040         woden_qname_or_token_any_attr_ops_t;
00041 struct axiom_element;
00042 struct axiom_node;
00043 
00044 #ifdef __cplusplus
00045 extern "C"
00046 {
00047 #endif
00048 
00049 struct woden_qname_or_token_any_attr_ops
00050 {
00055     axis2_status_t (AXIS2_CALL *
00056     free) (
00057             void *token_attr,
00058             const axis2_env_t *env);
00059     
00060     axis2_status_t (AXIS2_CALL *
00061     to_qname_or_token_any_attr_free) (
00062             void *token_attr,
00063             const axis2_env_t *env);
00064     
00065     woden_obj_types_t (AXIS2_CALL *
00066     type) (
00067             void *token_attr,
00068             const axis2_env_t *env);
00069 
00073     woden_xml_attr_t *(AXIS2_CALL *
00074     get_base_impl) (
00075             void *token_attr,
00076             const axis2_env_t *env);
00077 
00078     /* ************************************************************
00079      *  QNameAttr interface declared methods 
00080      * ************************************************************/
00081 
00082     axis2_bool_t (AXIS2_CALL *
00083     is_qname) (
00084             void *token_attr,
00085             const axis2_env_t *env); 
00086 
00087     axis2_bool_t (AXIS2_CALL *
00088     is_token) (
00089             void *token_attr,
00090             const axis2_env_t *env);
00091 
00092 
00093     axis2_qname_t *(AXIS2_CALL *
00094     get_qname) (
00095             void *token_attr,
00096             const axis2_env_t *env);
00097 
00098     axis2_char_t *(AXIS2_CALL *
00099     get_token) (
00100             void *token_attr,
00101             const axis2_env_t *env);
00102 
00103     /* ************************************************************
00104      *  Non-API implementation methods 
00105      * ************************************************************/
00106    
00107     /*
00108      * Convert a string of type "Union of xs:QName or xs:token #any" to a 
00109      * axis2_qname_t or a axis2_char_t.
00110      * A null argument will return a null value.
00111      * Any conversion error will be reported and a null value will be returned.
00112      */
00113     void *(AXIS2_CALL *
00114     convert) (
00115             void *token_attr,
00116             const axis2_env_t *env,
00117             struct axiom_element *owner_el,
00118             struct axiom_node *owner_node,
00119             axis2_char_t *attr_value);
00120 
00121 };
00122 
00123 struct woden_qname_or_token_any_attr
00124 {
00125     woden_xml_attr_t base;
00126     woden_qname_or_token_any_attr_ops_t *ops;
00127 };
00128 
00129 /*
00130  * TODO This constructor is not used for extension attributes, but may be useful if
00131  * parsing of native WSDL attributes is changed to use the XMLAttr interface.
00132  */
00133 AXIS2_EXTERN woden_qname_or_token_any_attr_t * AXIS2_CALL
00134 woden_qname_or_token_any_attr_create(
00135         const axis2_env_t *env,
00136         struct axiom_element *owner_el,
00137         struct axiom_node *owner_node,
00138         axis2_qname_t *attr_type,
00139         axis2_char_t *attr_value);
00140 
00141 
00142 /************************Woden C Internal Methods******************************/
00143 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00144 woden_qname_or_token_any_attr_resolve_methods(
00145         woden_qname_or_token_any_attr_t *token_attr,
00146         const axis2_env_t *env,
00147         axis2_hash_t *methods);
00148 /************************End of Woden C Internal Methods***********************/
00149 
00150 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_FREE(token_attr, env) \
00151       (((woden_qname_or_token_any_attr_t *) \
00152           token_attr)->ops->free(token_attr, env))
00153 
00154 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_TYPE(token_attr, env) \
00155       (((woden_qname_or_token_any_attr_t *) token_attr)->ops->\
00156          type(token_attr, env))
00157 
00158 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_GET_BASE_IMPL(token_attr, \
00159         env) \
00160       (((woden_qname_or_token_any_attr_t *) token_attr)->ops->\
00161          get_base_impl(token_attr, env))
00162 
00163 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_IS_QNAME(token_attr, env) \
00164       (((woden_qname_or_token_any_attr_t *) token_attr)->ops->\
00165          is_qname(token_attr, env))
00166 
00167 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_IS_TOKEN(token_attr, env) \
00168       (((woden_qname_or_token_any_attr_t *) \
00169           token_attr)->ops->is_token(token_attr, env))
00170 
00171 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_GET_QNAME(token_attr, env) \
00172       (((woden_qname_or_token_any_attr_t *) token_attr)->ops->\
00173          get_qname(token_attr, env))
00174 
00175 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_GET_TOKEN(token_attr, env) \
00176       (((woden_qname_or_token_any_attr_t *) token_attr)->ops->\
00177          get_token(token_attr, env))
00178 
00179 #define WODEN_QNAME_OR_TOKEN_ANY_ATTR_CONVERT(token_attr, env) \
00180       (((woden_qname_or_token_any_attr_t *) token_attr)->ops->\
00181          convert(token_attr, env))
00182 
00184 #ifdef __cplusplus
00185 }
00186 #endif
00187 #endif /* WODEN_QNAME_OR_TOKEN_ANY_ATTR_H */

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