woden_schema.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_SCHEMA_H
00018 #define WODEN_SCHEMA_H
00019 
00026 #include <axis2_allocator.h>
00027 #include <axis2_env.h>
00028 #include <axis2_error.h>
00029 #include <axis2_string.h>
00030 #include <axis2_utils.h>
00031 #include <axis2_hash.h>
00032 #include <axis2_uri.h>
00033 #include <woden.h>
00034 
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif
00039 
00040 typedef struct woden_schema woden_schema_t;
00041 typedef struct woden_schema_ops woden_schema_ops_t;
00042 struct xml_schema;
00043 
00049 struct woden_schema_ops
00050 {
00055     axis2_status_t (AXIS2_CALL *
00056     free) (
00057             void *schema,
00058             const axis2_env_t *env);
00059     
00060     woden_obj_types_t (AXIS2_CALL *
00061     type) (
00062             void *schema,
00063             const axis2_env_t *env);
00064     
00065     axis2_hash_t *(AXIS2_CALL *
00066     super_objs) (
00067             void *schema,
00068             const axis2_env_t *env);
00069 
00070     axis2_status_t (AXIS2_CALL *
00071     set_namespace) (
00072             void *schema,
00073             const axis2_env_t *env,
00074             axis2_uri_t *namespc);
00075 
00076     axis2_uri_t *(AXIS2_CALL *
00077     get_namespace) (
00078             void *schema,
00079             const axis2_env_t *env);
00080 
00081     axis2_status_t (AXIS2_CALL *
00082     set_schema_def) (
00083             void *schema,
00084             const axis2_env_t *env,
00085             struct xml_schema *schema_def);
00086 
00087     struct xml_schema *(AXIS2_CALL *
00088     get_schema_def) (
00089             void *schema,
00090             const axis2_env_t *env);
00091 
00092     /* ************************************************************
00093      *  Non-API implementation methods
00094      * ************************************************************/
00095 
00096     /* 
00097      * Indicates whether the schema is referenceable by the containing WSDL, as
00098      * defined by the WSDL 2.0 spec. In brief, a schema is referenceable if it is 
00099      * inlined directly under &lt;types&gt; and has a target namespace or if it is
00100      * resolved from a schema import directly under &lt;types&gt; and the import 
00101      * namespace matches the schema's target namespace.
00102      * So for example, when the API is used to retrieve the schema element 
00103      * declaration identified by a QName attribute, the implementation checks this
00104      * referenceable property to determine which schemas can be used to resolve the 
00105      * qname. 
00106      * Referenceability is determined during validation. If the validation feature
00107      * is disabled, any inlined or imported schema will be considered referenceable.
00108      */
00109     axis2_status_t (AXIS2_CALL *
00110     set_referenceable) (
00111             void *schema,
00112             const axis2_env_t *env,
00113             axis2_bool_t referenceable);
00114 
00115     axis2_bool_t (AXIS2_CALL *
00116     is_referenceable) (
00117             void *schema,
00118             const axis2_env_t *env);
00119 
00120     axis2_char_t *(AXIS2_CALL *
00121     get_namespace_as_string) (
00122             void *schema,
00123             const axis2_env_t *env);
00124 
00125   
00126 };
00127 
00128 struct woden_schema
00129 {
00130     woden_schema_ops_t *ops;
00131 };
00132 
00133 AXIS2_EXTERN woden_schema_t * AXIS2_CALL
00134 woden_schema_create(const axis2_env_t *env);
00135 
00136 /************************Woden C Internal Methods******************************/
00137 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00138 woden_schema_resolve_methods(
00139         woden_schema_t *schema,
00140         const axis2_env_t *env,
00141         woden_schema_t *schema_impl,
00142         axis2_hash_t *methods);
00143 /************************End of Woden C Internal Methods***********************/
00144 
00145 #define WODEN_SCHEMA_FREE(schema, env) \
00146       (((woden_schema_t *) schema)->ops->free (schema, env))
00147 
00148 #define WODEN_SCHEMA_SUPER_OBJS(schema, env) \
00149       (((woden_schema_t *) schema)->ops->super_objs (schema, env))
00150 
00151 #define WODEN_SCHEMA_TYPE(schema, env) \
00152       (((woden_schema_t *) schema)->ops->type (schema, env))
00153 
00154 #define WODEN_SCHEMA_SET_NAMESPACE(schema, env, namespc) \
00155       (((woden_schema_t *) schema)->ops->set_namespace(schema, env, \
00156                                                                namespc))
00157 
00158 #define WODEN_SCHEMA_GET_NAMESPACE(schema, env) \
00159       (((woden_schema_t *) schema)->ops->get_namespace(schema, env))
00160 
00161 #define WODEN_SCHEMA_SET_SCHEMA_DEF(schema, env, schema_def) \
00162       (((woden_schema_t *) schema)->ops->set_schema_def(schema, env, \
00163                                                                 schema_def))
00164 
00165 #define WODEN_SCHEMA_GET_SCHEMA_DEF(schema, env) \
00166       (((woden_schema_t *) schema)->ops->get_schema_def(schema, env))
00167 
00168 #define WODEN_SCHEMA_SET_REFERENCEABLE(schema, env, referenceable) \
00169       (((woden_schema_t *) schema)->ops->set_referenceable(schema, env, \
00170                                                              referenceable))
00171 
00172 #define WODEN_SCHEMA_IS_REFERENCEABLE(schema, env) \
00173       (((woden_schema_t *) schema)->ops->is_referenceable(schema, env))
00174 
00175 #define WODEN_SCHEMA_GET_NAMESPACE_AS_STRING(schema, env) \
00176       (((woden_schema_t *) schema)->ops->get_namespace_as_string(schema, \
00177                                                                          env))
00178 
00180 #ifdef __cplusplus
00181 }
00182 #endif
00183 #endif /* WODEN_SCHEMA_H */

Generated on Thu Aug 31 17:32:37 2006 for Axis2/C by  doxygen 1.4.6