woden_string_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_STRING_ATTR_H
00018 #define WODEN_STRING_ATTR_H
00019 
00026 #include <woden_xml_attr.h>
00027 #include <woden.h>
00028 
00034 typedef struct woden_string_attr woden_string_attr_t;
00035 typedef struct woden_string_attr_ops woden_string_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_string_attr_ops
00045 {
00050     axis2_status_t (AXIS2_CALL *
00051     free) (
00052             void *string_attr,
00053             const axis2_env_t *env);
00054     
00055     axis2_status_t (AXIS2_CALL *
00056     to_string_attr_free) (
00057             void *string_attr,
00058             const axis2_env_t *env);
00059     
00060     woden_obj_types_t (AXIS2_CALL *
00061     type) (
00062             void *string_attr,
00063             const axis2_env_t *env);
00064 
00068     woden_xml_attr_t *(AXIS2_CALL *
00069     get_base_impl) (
00070             void *string_attr,
00071             const axis2_env_t *env);
00072 
00073     /* ************************************************************
00074      *  QNameAttr interface declared methods 
00075      * ************************************************************/
00076 
00077     axis2_char_t *(AXIS2_CALL *
00078     get_string) (
00079             void *string_attr,
00080             const axis2_env_t *env);
00081 
00082     /* ************************************************************
00083      *  Non-API implementation methods 
00084      * ************************************************************/
00085   
00086     /*
00087      * Convert a string of type xs:string to a axis2_char_t.
00088      * 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 *string_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_string_attr
00103 {
00104     woden_xml_attr_t base;
00105     woden_string_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_string_attr_t * AXIS2_CALL
00113 woden_string_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_string_attr_resolve_methods(
00124         woden_string_attr_t *string_attr,
00125         const axis2_env_t *env,
00126         axis2_hash_t *methods);
00127 /************************End of Woden C Internal Methods***********************/
00128 
00129 #define WODEN_STRING_ATTR_FREE(string_attr, env) \
00130       (((woden_string_attr_t *) string_attr)->ops->\
00131          free(string_attr, env))
00132 
00133 #define WODEN_STRING_ATTR_TYPE(string_attr, env) \
00134       (((woden_string_attr_t *) string_attr)->ops->\
00135          type(string_attr, env))
00136 
00137 #define WODEN_STRING_ATTR_GET_BASE_IMPL(string_attr, env) \
00138       (((woden_string_attr_t *) string_attr)->ops->\
00139          get_base_impl(string_attr, env))
00140 
00141 #define WODEN_STRING_ATTR_GET_STRING(string_attr, env) \
00142       (((woden_string_attr_t *) string_attr)->ops->\
00143          get_string(string_attr, env))
00144 
00145 #define WODEN_STRING_ATTR_CONVERT(string_attr, env) \
00146       (((woden_string_attr_t *) string_attr)->ops->\
00147          convert(string_attr, env))
00148 
00150 #ifdef __cplusplus
00151 }
00152 #endif
00153 #endif /* WODEN_STRING_ATTR_H */

Generated on Thu Oct 26 21:11:24 2006 for Axis2/C by  doxygen 1.4.7