xml_schema_collection.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 XML_SCHEMA_COLLECTION_H
00018 #define XML_SCHEMA_COLLECTION_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 
00032 #include <axis2_array_list.h>
00033 #include <axis2_hash.h>
00034 #include <axis2_qname.h>
00035 #include <xml_schema_obj.h>
00036 #include <axiom_xml_reader.h>
00037 #include <axiom_document.h>
00038 
00039 #ifdef __cplusplus
00040 extern "C"
00041 {
00042 #endif
00043 
00044 typedef struct xml_schema_collection 
00045                 xml_schema_collection_t;
00046 typedef struct xml_schema_collection_ops 
00047                 xml_schema_collection_ops_t;
00048 struct xml_schema;
00049 struct axiom_node;
00050 struct xml_schema_type;
00051 
00057 struct xml_schema_collection_ops
00058 {
00059     axis2_status_t (AXIS2_CALL *
00060     free)(
00061             xml_schema_collection_t* collection,
00062             const axis2_env_t *env);
00063 
00064     axis2_status_t (AXIS2_CALL *
00065     set_base_uri)(
00066             xml_schema_collection_t* collection,
00067             const axis2_env_t *env,
00068             axis2_char_t *base_uri);
00069             
00070     axis2_char_t* (AXIS2_CALL*
00071     get_base_uri)(
00072             xml_schema_collection_t* collection,
00073             const axis2_env_t *env);
00074                         
00075                    
00076     axis2_status_t (AXIS2_CALL * 
00077     init)(
00078             xml_schema_collection_t* collection,
00079             const axis2_env_t *env);
00080 
00081 
00082     struct xml_schema* (AXIS2_CALL *
00083     read_with_reader)(
00084             xml_schema_collection_t* collection,
00085             const axis2_env_t *env,
00086             axiom_xml_reader_t *reader); 
00087 
00088     
00089     struct xml_schema *(AXIS2_CALL *
00090     read_document) (
00091             xml_schema_collection_t* collection,
00092             const axis2_env_t *env,
00093             axiom_document_t *document);
00094 
00095     struct xml_schema *(AXIS2_CALL *
00096     read_element)(
00097             xml_schema_collection_t* collection,
00098             const axis2_env_t *env,
00099             axiom_node_t *ele_node);
00100 
00101     struct xml_schema* (AXIS2_CALL *
00102     read_document_with_uri) (
00103             xml_schema_collection_t* collection,
00104             const axis2_env_t *env,
00105             axiom_document_t *document,
00106             axis2_char_t *uri); 
00107 
00108     struct xml_schema *(AXIS2_CALL *
00109     read_element_with_uri)(
00110             xml_schema_collection_t* collection,
00111             const axis2_env_t *env,
00112             axiom_node_t *ele_node,
00113             axis2_char_t *uri);
00114             
00115     struct xml_schema* (AXIS2_CALL *
00116     get_schema)(
00117             xml_schema_collection_t* collection,
00118             const axis2_env_t *env,
00119             axis2_char_t *system_id);
00120             
00121     struct xml_schema_element *(AXIS2_CALL *
00122     get_element_by_qname)(
00123             xml_schema_collection_t* collection,
00124             const axis2_env_t *env,
00125             axis2_qname_t *qname);
00126 
00127     struct xml_schema_type *(AXIS2_CALL *
00128     get_type_by_qname)(
00129             xml_schema_collection_t* collection,
00130             const axis2_env_t *env,
00131             axis2_qname_t *schema_type_qname);
00132 
00133 
00134     axis2_status_t (AXIS2_CALL *
00135     add_unresolved_type)(
00136             xml_schema_collection_t* collection,
00137             const axis2_env_t *env,
00138             axis2_qname_t *qtype, 
00139             void *receiver); 
00140             
00141 
00142     axis2_status_t (AXIS2_CALL *
00143     resolve_type)(
00144             xml_schema_collection_t* collection,
00145             const axis2_env_t *env,
00146             axis2_qname_t *type_qname, 
00147             struct xml_schema_type *type); 
00148             
00149 
00150     axis2_char_t *(AXIS2_CALL *
00151     get_namespace_for_prefix)(
00152             xml_schema_collection_t *collection,
00153             const axis2_env_t *env,
00154             axis2_char_t *prefix); 
00155                      
00156 
00157     axis2_status_t (AXIS2_CALL *
00158     map_namespace)(
00159             xml_schema_collection_t* collection,
00160             const axis2_env_t *env,
00161             axis2_char_t *prefix, 
00162             axis2_char_t *namespc_uri);
00163             
00164     axis2_hash_t* (AXIS2_CALL *
00165     get_systemid2_schemas)(
00166             xml_schema_collection_t* collection,
00167             const axis2_env_t *env);
00168             
00169     axis2_array_list_t* (AXIS2_CALL *
00170     get_schemas)(
00171             xml_schema_collection_t* collection,
00172             const axis2_env_t *env);
00173             
00174     axis2_status_t* (AXIS2_CALL *
00175     set_schemas)(
00176             xml_schema_collection_t *collection,
00177             const axis2_env_t *env,
00178             axis2_array_list_t *schemas);            
00179                       
00180     axis2_hash_t* (AXIS2_CALL *
00181     get_namespaces)(
00182             xml_schema_collection_t *collection,
00183             const axis2_env_t *env);
00184             
00185     axis2_status_t (AXIS2_CALL *
00186     set_namespaces)(
00187             xml_schema_collection_t *collection,
00188             const axis2_env_t *env);
00189             
00190                             
00191 };            
00192 
00193 struct xml_schema_collection
00194 {
00195     xml_schema_collection_ops_t *ops;
00196 };
00197 
00198 AXIS2_EXTERN xml_schema_collection_t * AXIS2_CALL
00199 xml_schema_collection_create(const axis2_env_t *env);
00200 
00201 /***************** MACROS *****************************************************/
00202 
00203 #define XML_SCHEMA_COLLECTION_FREE(collection, env) \
00204       ((collection)->ops->free (collection, env))
00205       
00206 #define XML_SCHEMA_COLLECTION_INIT(collection, env) \
00207       ((collection)->ops->init(collection, env))
00208       
00209 #define XML_SCHEMA_COLLECTION_READ_WITH_READER(collection, env, reader) \
00210         ((collection)->ops->read_with_reader( \
00211         collection, env, reader))
00212         
00213 #define XML_SCHEMA_COLLECTION_READ_DOCUMENT(collection, env, doc) \
00214         ((collection)->ops->read_document(collection, env, doc))
00215         
00216 #define XML_SCHEMA_COLLECTION_READ_DOCUMENT_WITH_URI(collection , env, document, uri) \
00217         ((collection)->ops->read_document_with_uri( \
00218         collection , env, document, uri))
00219         
00220 #define XML_SCHEMA_COLLECTION_READ_ELEMENT(collection, env, uri) \
00221         ((collection)->ops->read_element(collection, env, uri))
00222         
00223 #define XML_SCHEMA_COLLECTION_READ_ELEMENT_WITH_URI(collection, env, ele_node, uri ) \
00224         ((collection)->ops->read_element_with_uri(collection, env, ele_node, uri ))
00225         
00226 #define XML_SCHEMA_COLLECTION_GET_ELEMENT_BY_QNAME(collection, env, qname) \
00227         ((collection)->ops->get_element_by_qname(collection, env, qname))
00228         
00229 #define XML_SCHEMA_COLLECTION_GET_TYPE_BY_QNAME(collection, env, qname) \
00230         ((collection)->ops->get_type_by_qname(collection, env, qname))
00231         
00232 #define XML_SCHEMA_COLLECTION_GET_ELEMENT_BY_QNAME(collection, env, qname) \
00233         ((collection)->ops->get_element_by_qname(collection, env, qname))
00234         
00235 #define XML_SCHEMA_COLLECTION_ADD_UNRESOLVED_TYPE(collection, env, qtype, receiver) \
00236         ((collection)->ops->add_unresolved_type(collection, env, qtype, receiver))
00237         
00238 #define XML_SCHEMA_COLLECTION_RESOLVE_TYPE(collection, env, type_qname, type) \
00239         ((collection)->ops->resolve_type(collection, env, type_qname, type))
00240         
00241 #define XML_SCHEMA_COLLECTION_GET_NAMESPACE_FOR_PREFIX(collection, env, prefix) \
00242         ((collection)->ops->get_namespace_for_prefix(collection, env, prefix))
00243         
00244 #define XML_SCHEMA_COLLECTION_GET_SYSTEMID2_SCHEMAS(collection, env) \
00245         ((collection)->ops->get_systemid2_schemas(collection, env))
00246         
00247 #define XML_SCHEMA_COLLECTION_GET_SCHEMAS(collection, env) \
00248         ((collection)->ops->get_schemas(collection, env))
00249         
00250 #define XML_SCHEMA_COLLECTION_SET_SCHEMAS(collection, env) \
00251         ((collection)->ops->set_schemas(collection, env))
00252         
00253 #define XML_SCHEMA_COLLECTION_GET_NAMESPACES(collection, env) \
00254         ((collection)->ops->get_namespaces(collection, env))
00255         
00256 #define XML_SCHEMA_COLLECTION_SET_NAMESPACES(collection, env, ht_ns) \
00257         ((collection)->ops->set_namespaces(collection, env, ht_ns))                
00258         
00259 #define XML_SCHEMA_COLLECTION_GET_SCHEMA(collection, env, system_id) \
00260         ((collection)->ops->get_schema(collection, env, system_id))
00261         
00262 #define XML_SCHEMA_COLLECTION_SET_BASE_URI(collection, env, base_uri) \
00263       ((collection)->ops->set_base_uri (collection, env, base_uri))
00264       
00265 #define XML_SCHEMA_COLLECTION_GET_BASE_URI(collection, env) \
00266         ((collection)->ops->get_base_uri(collection, env))
00267         
00269 #ifdef __cplusplus
00270 }
00271 #endif
00272 #endif /* XML_SCHEMA_COLLECTION_H */

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