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

Generated on Wed Dec 20 20:34:50 2006 for Axis2/C by  doxygen 1.5.1