woden_schema.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef WODEN_SCHEMA_H
00019 #define WODEN_SCHEMA_H
00020 
00027 #include <axis2_allocator.h>
00028 #include <axis2_env.h>
00029 #include <axis2_error.h>
00030 #include <axis2_string.h>
00031 #include <axis2_utils.h>
00032 #include <axis2_hash.h>
00033 #include <axis2_uri.h>
00034 #include <woden.h>
00035 
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040 
00041 typedef struct woden_schema woden_schema_t;
00042 typedef struct woden_schema_ops woden_schema_ops_t;
00043 struct xml_schema;
00044 
00050 struct woden_schema_ops
00051 {
00056     axis2_status_t (AXIS2_CALL *
00057     free) (
00058             void *schema,
00059             const axis2_env_t *env);
00060     
00061     woden_obj_types_t (AXIS2_CALL *
00062     type) (
00063             void *schema,
00064             const axis2_env_t *env);
00065     
00066     axis2_hash_t *(AXIS2_CALL *
00067     super_objs) (
00068             void *schema,
00069             const axis2_env_t *env);
00070 
00071     axis2_status_t (AXIS2_CALL *
00072     set_namespace) (
00073             void *schema,
00074             const axis2_env_t *env,
00075             axis2_uri_t *namespc);
00076 
00077     axis2_uri_t *(AXIS2_CALL *
00078     get_namespace) (
00079             void *schema,
00080             const axis2_env_t *env);
00081 
00082     axis2_status_t (AXIS2_CALL *
00083     set_schema_def) (
00084             void *schema,
00085             const axis2_env_t *env,
00086             struct xml_schema *schema_def);
00087 
00088     struct xml_schema *(AXIS2_CALL *
00089     get_schema_def) (
00090             void *schema,
00091             const axis2_env_t *env);
00092 
00093     /* ************************************************************
00094      *  Non-API implementation methods
00095      * ************************************************************/
00096 
00097     /* 
00098      * Indicates whether the schema is referenceable by the containing WSDL, as
00099      * defined by the WSDL 2.0 spec. In brief, a schema is referenceable if it is 
00100      * inlined directly under &lt;types&gt; and has a target namespace or if it is
00101      * resolved from a schema import directly under &lt;types&gt; and the import 
00102      * namespace matches the schema's target namespace.
00103      * So for example, when the API is used to retrieve the schema element 
00104      * declaration identified by a QName attribute, the implementation checks this
00105      * referenceable property to determine which schemas can be used to resolve the 
00106      * qname. 
00107      * Referenceability is determined during validation. If the validation feature
00108      * is disabled, any inlined or imported schema will be considered referenceable.
00109      */
00110     axis2_status_t (AXIS2_CALL *
00111     set_referenceable) (
00112             void *schema,
00113             const axis2_env_t *env,
00114             axis2_bool_t referenceable);
00115 
00116     axis2_bool_t (AXIS2_CALL *
00117     is_referenceable) (
00118             void *schema,
00119             const axis2_env_t *env);
00120 
00121     axis2_char_t *(AXIS2_CALL *
00122     get_namespace_as_string) (
00123             void *schema,
00124             const axis2_env_t *env);
00125 
00126   
00127 };
00128 
00129 struct woden_schema
00130 {
00131     woden_schema_ops_t *ops;
00132 };
00133 
00134 AXIS2_EXTERN woden_schema_t * AXIS2_CALL
00135 woden_schema_create(const axis2_env_t *env);
00136 
00137 /************************Woden C Internal Methods******************************/
00138 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00139 woden_schema_resolve_methods(
00140         woden_schema_t *schema,
00141         const axis2_env_t *env,
00142         woden_schema_t *schema_impl,
00143         axis2_hash_t *methods);
00144 /************************End of Woden C Internal Methods***********************/
00145 
00146 #define WODEN_SCHEMA_FREE(schema, env) \
00147       (((woden_schema_t *) schema)->ops->free (schema, env))
00148 
00149 #define WODEN_SCHEMA_SUPER_OBJS(schema, env) \
00150       (((woden_schema_t *) schema)->ops->super_objs (schema, env))
00151 
00152 #define WODEN_SCHEMA_TYPE(schema, env) \
00153       (((woden_schema_t *) schema)->ops->type (schema, env))
00154 
00155 #define WODEN_SCHEMA_SET_NAMESPACE(schema, env, namespc) \
00156       (((woden_schema_t *) schema)->ops->set_namespace(schema, env, \
00157                                                                namespc))
00158 
00159 #define WODEN_SCHEMA_GET_NAMESPACE(schema, env) \
00160       (((woden_schema_t *) schema)->ops->get_namespace(schema, env))
00161 
00162 #define WODEN_SCHEMA_SET_SCHEMA_DEF(schema, env, schema_def) \
00163       (((woden_schema_t *) schema)->ops->set_schema_def(schema, env, \
00164                                                                 schema_def))
00165 
00166 #define WODEN_SCHEMA_GET_SCHEMA_DEF(schema, env) \
00167       (((woden_schema_t *) schema)->ops->get_schema_def(schema, env))
00168 
00169 #define WODEN_SCHEMA_SET_REFERENCEABLE(schema, env, referenceable) \
00170       (((woden_schema_t *) schema)->ops->set_referenceable(schema, env, \
00171                                                              referenceable))
00172 
00173 #define WODEN_SCHEMA_IS_REFERENCEABLE(schema, env) \
00174       (((woden_schema_t *) schema)->ops->is_referenceable(schema, env))
00175 
00176 #define WODEN_SCHEMA_GET_NAMESPACE_AS_STRING(schema, env) \
00177       (((woden_schema_t *) schema)->ops->get_namespace_as_string(schema, \
00178                                                                          env))
00179 
00181 #ifdef __cplusplus
00182 }
00183 #endif
00184 #endif /* WODEN_SCHEMA_H */

Generated on Wed Dec 20 20:14:10 2006 for Axis2/C by  doxygen 1.5.1