Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Examples

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

Generated on Fri Jun 16 18:02:32 2006 for Axis2/C by  doxygen 1.4.2