You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2006/05/15 11:31:15 UTC
svn commit: r406594 [5/8] - in
/webservices/axis2/trunk/c/modules/xml/xml_schema: ./ include/xml_schema/
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_complex_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_complex_type.c?rev=406594&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_complex_type.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_complex_type.c Mon May 15 02:31:10 2006
@@ -0,0 +1,674 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <xml_schema/axis2_xml_schema.h>
+#include <xml_schema/axis2_xml_schema_constants.h>
+#include <xml_schema/axis2_xml_schema_complex_type.h>
+#include <xml_schema/axis2_xml_schema_data_type.h>
+#include <xml_schema/axis2_xml_schema_derivation_method.h>
+#include <axis2_qname.h>
+
+typedef struct axis2_xml_schema_complex_type_impl
+ axis2_xml_schema_complex_type_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_complex_type_impl
+{
+ axis2_xml_schema_complex_type_t complex_type;
+
+ /** parent type */
+ axis2_xml_schema_type_t *schema_type;
+
+ axis2_xml_schema_any_attribute_t *any_attr, *attr_wildcard;
+
+ axis2_xml_schema_obj_collection_t *attributes;
+
+ axis2_xml_schema_obj_table_t *attr_uses;
+
+ axis2_xml_schema_derivation_method_t *block, *block_resolved;
+
+ /** type stores the type of model stored in content_model */
+ void *content_model;
+
+ axis2_xml_schema_content_type_t *content_type;
+
+ axis2_xml_schema_particle_t *particle_type, *particle;
+
+ axis2_bool_t is_abstract, is_mixed;
+
+ axis2_xml_schema_types_t obj_type;
+
+ axis2_hash_t *ht_super;
+
+ axis2_hash_t *methods;
+
+};
+
+#define AXIS2_INTF_TO_IMPL(complex_type) \
+ ((axis2_xml_schema_complex_type_impl_t *) complex_type)
+
+/************************** function prototypes ******************************/
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_free(
+ void *complex_type,
+ axis2_env_t **env);
+
+
+axis2_xml_schema_type_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_base_impl(
+ void *complex_type,
+ axis2_env_t **env);
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_complex_type_type(
+ void *complex_type,
+ axis2_env_t **env);
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_complex_type_super_objs(
+ void *complex_type,
+ axis2_env_t **env);
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_any_attribute(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_any_attribute(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_any_attribute_t *any_attr);
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_attributes(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_attribute_use(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_attribute_wildcard(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_xml_schema_derivation_method_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_block(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_block(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t *block);
+
+axis2_xml_schema_derivation_method_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_block_resolved(
+ void *cmp_type,
+ axis2_env_t **env);
+
+void* AXIS2_CALL
+axis2_xml_schema_complex_type_get_content_model(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_content_model(
+ void *cmp_type,
+ axis2_env_t **env,
+ void *content_model);
+
+axis2_xml_schema_content_type_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_content_type(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_content_type(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_content_type_t *content_type);
+
+axis2_xml_schema_particle_t * AXIS2_CALL
+axis2_xml_schema_complex_type_get_content_type_particle(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_complex_type_is_abstract(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_abstract(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_bool_t b);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_complex_type_is_mixed(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_mixed(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_bool_t b);
+
+axis2_xml_schema_particle_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_particle(
+ void *cmp_type,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_particle(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_particle_t *particle);
+
+axis2_char_t* AXIS2_CALL
+axis2_xml_schema_complex_type_to_string(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_char_t *prefix,
+ int tab);
+
+
+/************************** end ***********************************************/
+
+AXIS2_DECLARE(axis2_xml_schema_complex_type_t *)
+axis2_xml_schema_complex_type_create(axis2_env_t **env,
+ axis2_xml_schema_t *schema)
+{
+ axis2_xml_schema_complex_type_impl_t *complex_type_impl = NULL;
+ axis2_xml_schema_annotated_t *annotated = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ complex_type_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_complex_type_impl_t));
+ if(!complex_type_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ complex_type_impl->any_attr = NULL;
+ complex_type_impl->attr_uses = NULL;
+ complex_type_impl->attr_wildcard = NULL;
+ complex_type_impl->attributes = NULL;
+ complex_type_impl->block = NULL;
+ complex_type_impl->block_resolved = NULL;
+ complex_type_impl->complex_type.ops = NULL;
+ complex_type_impl->complex_type.base.ops = NULL;
+ complex_type_impl->content_model = NULL;
+ complex_type_impl->content_type = NULL;
+ complex_type_impl->attr_uses = NULL;
+ complex_type_impl->is_mixed = AXIS2_FALSE;
+ complex_type_impl->is_abstract = AXIS2_FALSE;
+ complex_type_impl->ht_super = NULL;
+ complex_type_impl->obj_type = AXIS2_XML_SCHEMA_COMPLEX_TYPE;
+ complex_type_impl->methods = NULL;
+
+ complex_type_impl->complex_type.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_complex_type_ops_t));
+ if(!complex_type_impl->complex_type.ops)
+ {
+ axis2_xml_schema_complex_type_free(&(complex_type_impl->complex_type), env);
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ complex_type_impl->schema_type = axis2_xml_schema_type_create(env, schema);
+ if(!complex_type_impl->schema_type)
+ {
+ axis2_xml_schema_complex_type_free(&(complex_type_impl->complex_type), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ complex_type_impl->attributes = axis2_xml_schema_obj_collection_create(env);
+
+ if(!complex_type_impl->attributes)
+ {
+ axis2_xml_schema_complex_type_free(&(complex_type_impl->complex_type), env);
+ return NULL;
+ }
+
+ complex_type_impl->block = axis2_xml_schema_derivation_method_create(env, "none");
+ if(!complex_type_impl->block)
+ {
+ axis2_xml_schema_complex_type_free(&(complex_type_impl->complex_type), env);
+ return NULL;
+ }
+
+ complex_type_impl->complex_type.ops->free =
+ axis2_xml_schema_complex_type_free;
+ complex_type_impl->complex_type.ops->type =
+ axis2_xml_schema_complex_type_type;
+ complex_type_impl->complex_type.ops->super_objs =
+ axis2_xml_schema_complex_type_super_objs;
+ complex_type_impl->complex_type.ops->get_base_impl =
+ axis2_xml_schema_complex_type_get_base_impl;
+ complex_type_impl->complex_type.ops->get_any_attribute =
+ axis2_xml_schema_complex_type_get_any_attribute;
+ complex_type_impl->complex_type.ops->set_any_attribute =
+ axis2_xml_schema_complex_type_set_any_attribute;
+ complex_type_impl->complex_type.ops->get_attributes =
+ axis2_xml_schema_complex_type_get_attributes;
+ complex_type_impl->complex_type.ops->get_attribute_use =
+ axis2_xml_schema_complex_type_get_attribute_use;
+ complex_type_impl->complex_type.ops->get_attribute_wildcard =
+ axis2_xml_schema_complex_type_get_attribute_wildcard;
+ complex_type_impl->complex_type.ops->get_block =
+ axis2_xml_schema_complex_type_get_block;
+ complex_type_impl->complex_type.ops->set_block =
+ axis2_xml_schema_complex_type_set_block;
+ complex_type_impl->complex_type.ops->get_block_resolved =
+ axis2_xml_schema_complex_type_get_block_resolved;
+ complex_type_impl->complex_type.ops->get_content_model =
+ axis2_xml_schema_complex_type_get_content_model;
+ complex_type_impl->complex_type.ops->set_content_model =
+ axis2_xml_schema_complex_type_set_content_model;
+ complex_type_impl->complex_type.ops->get_content_type =
+ axis2_xml_schema_complex_type_get_content_type;
+ complex_type_impl->complex_type.ops->set_content_type =
+ axis2_xml_schema_complex_type_set_content_type;
+ complex_type_impl->complex_type.ops->get_content_type_particle =
+ axis2_xml_schema_complex_type_get_content_type_particle;
+ complex_type_impl->complex_type.ops->is_abstract =
+ axis2_xml_schema_complex_type_is_abstract;
+ complex_type_impl->complex_type.ops->set_abstract =
+ axis2_xml_schema_complex_type_set_abstract;
+ complex_type_impl->complex_type.ops->is_mixed =
+ axis2_xml_schema_complex_type_is_mixed;
+ complex_type_impl->complex_type.ops->set_mixed =
+ axis2_xml_schema_complex_type_set_mixed;
+ complex_type_impl->complex_type.ops->get_particle =
+ axis2_xml_schema_complex_type_get_particle;
+ complex_type_impl->complex_type.ops->set_particle =
+ axis2_xml_schema_complex_type_set_particle;
+ complex_type_impl->complex_type.ops->to_string =
+ axis2_xml_schema_complex_type_to_string;
+
+ complex_type_impl->methods = axis2_hash_make(env);
+ complex_type_impl->ht_super = axis2_hash_make(env);
+
+ if(!complex_type_impl->methods || !complex_type_impl->ht_super)
+ {
+ axis2_xml_schema_complex_type_free(&(complex_type_impl->complex_type), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(complex_type_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_free);
+ axis2_hash_set(complex_type_impl->methods, "type", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_type);
+ axis2_hash_set(complex_type_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_super_objs);
+ axis2_hash_set(complex_type_impl->methods, "get_any_attribute", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_any_attribute);
+ axis2_hash_set(complex_type_impl->methods, "set_any_attribute", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_set_any_attribute);
+ axis2_hash_set(complex_type_impl->methods, "get_attributes", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_attributes);
+ axis2_hash_set(complex_type_impl->methods, "get_attribute_use", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_attribute_use);
+ axis2_hash_set(complex_type_impl->methods, "get_attribute_wildcare", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_attribute_wildcard);
+ axis2_hash_set(complex_type_impl->methods, "get_block", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_block);
+ axis2_hash_set(complex_type_impl->methods, "set_block", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_set_block);
+ axis2_hash_set(complex_type_impl->methods, "get_block_resolved", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_block_resolved);
+ axis2_hash_set(complex_type_impl->methods, "get_content_model", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_content_model);
+ axis2_hash_set(complex_type_impl->methods, "set_content_model", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_set_content_model);
+ axis2_hash_set(complex_type_impl->methods, "get_content_type", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_content_type);
+ axis2_hash_set(complex_type_impl->methods, "set_content_type", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_set_content_type);
+ axis2_hash_set(complex_type_impl->methods, "get_content_type_particle",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_complex_type_get_content_type_particle);
+ axis2_hash_set(complex_type_impl->methods, "is_abstract", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_is_abstract);
+ axis2_hash_set(complex_type_impl->methods, "set_abstract", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_set_abstract);
+ axis2_hash_set(complex_type_impl->methods, "is_mixed", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_is_mixed);
+ axis2_hash_set(complex_type_impl->methods, "set_mixed", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_set_mixed);
+ axis2_hash_set(complex_type_impl->methods, "get_particle", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_get_particle);
+ axis2_hash_set(complex_type_impl->methods, "set_particle", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_set_particle);
+ axis2_hash_set(complex_type_impl->methods, "to_string", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_complex_type_to_string);
+
+ axis2_hash_set(complex_type_impl->ht_super, "AXIS2_XML_SCHEMA_COMPLEX_TYPE",
+ AXIS2_HASH_KEY_STRING, &(complex_type_impl->complex_type));
+ axis2_hash_set(complex_type_impl->ht_super, "AXIS2_XML_SCHEMA_TYPE",
+ AXIS2_HASH_KEY_STRING, complex_type_impl->schema_type);
+
+ annotated =
+ AXIS2_XML_SCHEMA_TYPE_GET_BASE_IMPL(complex_type_impl->schema_type, env);
+ if(NULL != annotated)
+ {
+ axis2_hash_set(complex_type_impl->ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING, annotated);
+ axis2_hash_set(complex_type_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ",
+ AXIS2_HASH_KEY_STRING,
+ AXIS2_XML_SCHEMA_ANNOTATED_GET_BASE_IMPL(annotated, env));
+ }
+
+ axis2_hash_set(complex_type_impl->ht_super, "AXIS2_XML_SCHEMA_COMPLEX_TYPE",
+ AXIS2_HASH_KEY_STRING, &(complex_type_impl->complex_type));
+
+ axis2_xml_schema_type_resolve_methods(&(complex_type_impl->complex_type.base), env,
+ complex_type_impl->schema_type, complex_type_impl->methods);
+
+
+ return &(complex_type_impl->complex_type);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_free(void *complex_type,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_complex_type_impl_t *complex_type_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ complex_type_impl = AXIS2_INTF_TO_IMPL(complex_type);
+
+ if(NULL != complex_type_impl->schema_type)
+ {
+ AXIS2_XML_SCHEMA_TYPE_FREE(complex_type_impl->schema_type, env);
+ complex_type_impl->schema_type = NULL;
+ }
+ if(NULL != complex_type_impl->complex_type.base.ops)
+ {
+ AXIS2_FREE((*env)->allocator, complex_type_impl->complex_type.base.ops);
+ complex_type_impl->complex_type.base.ops = NULL;
+ }
+
+ if(NULL != complex_type_impl->complex_type.ops)
+ {
+ AXIS2_FREE((*env)->allocator, complex_type_impl->complex_type.ops);
+ complex_type_impl->complex_type.ops = NULL;
+ }
+ AXIS2_FREE((*env)->allocator, complex_type_impl);
+ complex_type_impl = NULL;
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_type_t *AXIS2_CALL
+axis2_xml_schema_complex_type_get_base_impl(
+ void *complex_type,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_complex_type_impl_t *complex_type_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ complex_type_impl = AXIS2_INTF_TO_IMPL(complex_type);
+ return complex_type_impl->schema_type;
+
+}
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_any_attribute(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->any_attr;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_any_attribute(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_any_attribute_t *any_attr)
+{
+ axis2_xml_schema_complex_type_impl_t *cmp_type_impl = NULL;
+
+ cmp_type_impl = AXIS2_INTF_TO_IMPL(cmp_type);
+ if(NULL != cmp_type_impl->any_attr)
+ {
+ /** TODO free attribute */
+ }
+ cmp_type_impl->any_attr= any_attr;
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_attributes(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->attributes;
+}
+
+axis2_xml_schema_obj_table_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_attribute_use(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->attr_uses;
+}
+
+axis2_xml_schema_any_attribute_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_attribute_wildcard(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->attr_wildcard;
+}
+
+axis2_xml_schema_derivation_method_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_block(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->block;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_block(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t *block)
+{
+ axis2_xml_schema_complex_type_impl_t *cmp_type_impl = NULL;
+ cmp_type_impl = AXIS2_INTF_TO_IMPL(cmp_type);
+ if(NULL != cmp_type_impl->block)
+ {
+ /** TODO free block */
+ }
+
+ cmp_type_impl->block = block;
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_derivation_method_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_block_resolved(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->block_resolved;
+
+}
+
+void* AXIS2_CALL
+axis2_xml_schema_complex_type_get_content_model(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->content_model;
+
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_content_model(
+ void *cmp_type,
+ axis2_env_t **env,
+ void *content_model)
+{
+ axis2_xml_schema_complex_type_impl_t *cmp_type_impl = NULL;
+ cmp_type_impl = AXIS2_INTF_TO_IMPL(cmp_type);
+
+ if(NULL != cmp_type_impl->content_model)
+ {
+ /** TODO free content_model_type */
+ }
+ AXIS2_INTF_TO_IMPL(cmp_type)->content_model = content_model;
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_content_type_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_content_type(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->content_type;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_content_type(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_content_type_t *content_type)
+{
+ axis2_xml_schema_complex_type_impl_t *cmp_type_impl = NULL;
+
+ cmp_type_impl = AXIS2_INTF_TO_IMPL(cmp_type);
+ if(NULL != cmp_type_impl->content_type)
+ {
+ /** TODO free */
+ }
+ cmp_type_impl->content_type = content_type;
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_particle_t * AXIS2_CALL
+axis2_xml_schema_complex_type_get_content_type_particle(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->particle_type;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_complex_type_is_abstract(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->is_abstract;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_abstract(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_bool_t b)
+{
+ AXIS2_INTF_TO_IMPL(cmp_type)->is_abstract = b;
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_complex_type_is_mixed(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->is_mixed;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_mixed(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_bool_t b)
+{
+ AXIS2_INTF_TO_IMPL(cmp_type)->is_mixed = b;
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_particle_t* AXIS2_CALL
+axis2_xml_schema_complex_type_get_particle(
+ void *cmp_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(cmp_type)->particle;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_complex_type_set_particle(
+ void *cmp_type,
+ axis2_env_t **env,
+ axis2_xml_schema_particle_t *particle)
+{
+ axis2_xml_schema_complex_type_impl_t *cmp_type_impl = NULL;
+ cmp_type_impl = AXIS2_INTF_TO_IMPL(cmp_type);
+ if(NULL != cmp_type_impl->particle)
+ {
+ /** TODO free particle */
+ }
+ cmp_type_impl->particle = particle;
+ return AXIS2_SUCCESS;
+}
+
+
+
+axis2_char_t* AXIS2_CALL
+axis2_xml_schema_complex_type_to_string(
+ void *complex_type,
+ axis2_env_t **env,
+ axis2_char_t *prefix,
+ int tab)
+{
+ axis2_xml_schema_complex_type_impl_t *complex_type_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ complex_type_impl = AXIS2_INTF_TO_IMPL(complex_type);
+ /** TODO implement the method */
+ return NULL;
+}
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_complex_type_type(
+ void *complex_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(complex_type)->obj_type;
+}
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_complex_type_super_objs(
+ void *complex_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(complex_type)->ht_super;
+}
\ No newline at end of file
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c Mon May 15 02:31:10 2006
@@ -15,6 +15,7 @@
*/
#include <xml_schema/axis2_xml_schema_content_processing.h>
+#include <xml_schema/axis2_xml_schema_use.h>
typedef struct axis2_xml_schema_content_processing_impl
axis2_xml_schema_content_processing_impl_t;
@@ -28,8 +29,11 @@
axis2_xml_schema_content_processing_t content_processing;
axis2_xml_schema_enum_t *schema_enum;
+
axis2_xml_schema_types_t obj_type;
- axis2_hash_t *super;
+
+ axis2_hash_t *ht_super;
+
axis2_hash_t *methods;
axis2_array_list_t *members;
@@ -80,7 +84,7 @@
content_processing_impl->schema_enum = NULL;
content_processing_impl->content_processing.base.ops = NULL;
content_processing_impl->obj_type = AXIS2_XML_SCHEMA_CONTENT_PROCESSING;
- content_processing_impl->super = NULL;
+ content_processing_impl->ht_super = NULL;
content_processing_impl->methods = NULL;
content_processing_impl->members = NULL;
content_processing_impl->content_processing.ops = NULL;
@@ -104,21 +108,26 @@
axis2_xml_schema_content_processing_type;
content_processing_impl->content_processing.ops->get_base_impl =
axis2_xml_schema_content_processing_get_base_impl;
-
content_processing_impl->content_processing.ops->get_values =
axis2_xml_schema_content_processing_get_values;
content_processing_impl->members = axis2_array_list_create(env, 0);
+
if(!content_processing_impl->members)
{
axis2_xml_schema_content_processing_free(
&(content_processing_impl->content_processing), env);
return NULL;
}
- AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "Lax");
- AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "None");
- AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "Skip");
- AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "Strict");
+
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_LAX, env));
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_NONE, env));
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_SKIP, env));
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_STRICT, env));
content_processing_impl->methods = axis2_hash_make(env);
if(!content_processing_impl->methods)
@@ -141,8 +150,8 @@
content_processing_impl->schema_enum = axis2_xml_schema_enum_create(env, NULL);
- content_processing_impl->super = axis2_hash_make(env);
- if(!content_processing_impl->super)
+ content_processing_impl->ht_super = axis2_hash_make(env);
+ if(!content_processing_impl->ht_super)
{
axis2_xml_schema_content_processing_free(
&(content_processing_impl->content_processing), env);
@@ -150,10 +159,10 @@
return NULL;
}
- axis2_hash_set(content_processing_impl->super, "AXIS2_XML_SCHEMA_CONTENT_PROCESSING",
+ axis2_hash_set(content_processing_impl->ht_super, "AXIS2_XML_SCHEMA_CONTENT_PROCESSING",
AXIS2_HASH_KEY_STRING, &(content_processing_impl->content_processing));
- axis2_hash_set(content_processing_impl->super, "AXIS2_XML_SCHEMA_ENUM",
+ axis2_hash_set(content_processing_impl->ht_super, "AXIS2_XML_SCHEMA_ENUM",
AXIS2_HASH_KEY_STRING, content_processing_impl->schema_enum);
status = axis2_xml_schema_enum_resolve_methods(
@@ -193,10 +202,10 @@
content_processing_impl->members = NULL;
}
- if(NULL != content_processing_impl->super)
+ if(NULL != content_processing_impl->ht_super)
{
- axis2_hash_free(content_processing_impl->super, env);
- content_processing_impl->super = NULL;
+ axis2_hash_free(content_processing_impl->ht_super, env);
+ content_processing_impl->ht_super = NULL;
}
if(NULL != content_processing_impl->methods)
@@ -239,7 +248,7 @@
AXIS2_ENV_CHECK(env, NULL);
content_processing_impl = AXIS2_INTF_TO_IMPL(content_processing);
- return content_processing_impl->super;
+ return content_processing_impl->ht_super;
}
axis2_xml_schema_types_t AXIS2_CALL
@@ -266,39 +275,6 @@
content_processing_impl = AXIS2_INTF_TO_IMPL(content_processing);
return content_processing_impl->schema_enum;
-}
-
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_schema_content_processing_resolve_methods(
- axis2_xml_schema_content_processing_t *content_processing,
- axis2_env_t **env,
- axis2_xml_schema_content_processing_t *content_processing_impl,
- axis2_hash_t *methods)
-{
- axis2_xml_schema_content_processing_impl_t *content_processing_impl_l = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, content_processing_impl, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-
- content_processing_impl_l = (axis2_xml_schema_content_processing_impl_t *)
- content_processing_impl;
-
- content_processing->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_xml_schema_content_processing_ops_t));
- content_processing->ops->free = axis2_hash_get(methods, "free",
- AXIS2_HASH_KEY_STRING);
-
-
- content_processing->ops->get_values = axis2_hash_get(methods, "get_values",
- AXIS2_HASH_KEY_STRING);
- if(!content_processing->ops->get_values)
- content_processing->ops->get_values =
- content_processing_impl_l->content_processing.ops->get_values;
-
- return axis2_xml_schema_enum_resolve_methods(
- &(content_processing->base),
- env, content_processing_impl_l->schema_enum, methods);
}
axis2_array_list_t *AXIS2_CALL
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_type.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_type.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_type.c Mon May 15 02:31:10 2006
@@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+#include <xml_schema/axis2_xml_schema_defines.h>
#include <xml_schema/axis2_xml_schema_content_type.h>
+#include <axis2_string.h>
+
typedef struct axis2_xml_schema_content_type_impl
axis2_xml_schema_content_type_impl_t;
@@ -26,9 +28,16 @@
struct axis2_xml_schema_content_type_impl
{
axis2_xml_schema_content_type_t content_type;
+
axis2_xml_schema_enum_t *schema_enum;
+
axis2_hash_t *methods;
+
+ axis2_xml_schema_types_t obj_type;
+
axis2_array_list_t *members;
+
+ axis2_hash_t *ht_super;
};
#define AXIS2_INTF_TO_IMPL(content_type) \
@@ -52,6 +61,16 @@
axis2_array_list_t *AXIS2_CALL
axis2_xml_schema_content_type_get_values(void *content_type,
axis2_env_t **env);
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_content_type_type(void *content_type,
+ axis2_env_t **env);
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_content_type_super_objs(void *content_type,
+ axis2_env_t **env);
+
+
AXIS2_DECLARE(axis2_xml_schema_content_type_t *)
@@ -72,6 +91,9 @@
content_type_impl->schema_enum = NULL;
content_type_impl->methods = NULL;
content_type_impl->members = NULL;
+ content_type_impl->obj_type = AXIS2_XML_SCHEMA_CONTENT_TYPE;
+ content_type_impl->ht_super = NULL;
+
content_type_impl->content_type.ops = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_xml_schema_content_type_ops_t));
if(!content_type_impl->content_type.ops)
@@ -88,16 +110,28 @@
axis2_xml_schema_content_type_get_base_impl;
content_type_impl->content_type.ops->get_values =
axis2_xml_schema_content_type_get_values;
-
+ content_type_impl->content_type.ops->type =
+ axis2_xml_schema_content_type_type;
+ content_type_impl->content_type.ops->super_objs =
+ axis2_xml_schema_content_type_super_objs;
+
content_type_impl->members = axis2_array_list_create(env, 0);
if(!content_type_impl->members)
{
axis2_xml_schema_content_type_free(&(content_type_impl->content_type), env);
return NULL;
}
- AXIS2_ARRAY_LIST_ADD(content_type_impl->members, env, "qualified");
- AXIS2_ARRAY_LIST_ADD(content_type_impl->members, env, "unqualified");
- AXIS2_ARRAY_LIST_ADD(content_type_impl->members, env, "none");
+
+ AXIS2_ARRAY_LIST_ADD(content_type_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_ELEMENT_ONLY, env));
+ AXIS2_ARRAY_LIST_ADD(content_type_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_EMPTY, env));
+
+ AXIS2_ARRAY_LIST_ADD(content_type_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_MIXED, env));
+
+ AXIS2_ARRAY_LIST_ADD(content_type_impl->members, env,
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_TEXT_ONLY, env));
content_type_impl->methods = axis2_hash_make(env);
if(!content_type_impl->methods)
@@ -111,7 +145,11 @@
axis2_xml_schema_content_type_free);
axis2_hash_set(content_type_impl->methods, "get_values", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_content_type_get_values);
-
+ axis2_hash_set(content_type_impl->methods, "type", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_content_type_type);
+ axis2_hash_set(content_type_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_content_type_super_objs);
+
content_type_impl->schema_enum = axis2_xml_schema_enum_create(env, value);
if(!content_type_impl->schema_enum)
{
@@ -119,6 +157,18 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+ content_type_impl->ht_super = axis2_hash_make(env);
+ if(!content_type_impl->ht_super)
+ {
+ axis2_xml_schema_content_type_free(&(content_type_impl->content_type), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ axis2_hash_set(content_type_impl->ht_super, "AXIS2_XML_SCHEMA_CONTENT_TYPE",
+ AXIS2_HASH_KEY_STRING, &(content_type_impl->content_type));
+ axis2_hash_set(content_type_impl->ht_super, "AXIS2_XML_SCHEMA_ENUM", AXIS2_HASH_KEY_STRING,
+ content_type_impl->schema_enum);
status = axis2_xml_schema_enum_resolve_methods(
&(content_type_impl->content_type.base), env, content_type_impl->schema_enum,
@@ -186,38 +236,29 @@
return content_type_impl->schema_enum;
}
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_schema_content_type_resolve_methods(
- axis2_xml_schema_content_type_t *content_type,
- axis2_env_t **env,
- axis2_xml_schema_content_type_t *content_type_impl,
- axis2_hash_t *methods)
-{
- axis2_xml_schema_content_type_impl_t *content_type_impl_l = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, content_type_impl, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-
- content_type_impl_l = (axis2_xml_schema_content_type_impl_t *) content_type_impl;
-
- content_type->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_xml_schema_content_type_ops_t));
- content_type->ops->free = axis2_hash_get(methods, "free",
- AXIS2_HASH_KEY_STRING);
- content_type->ops->get_base_impl =
- content_type_impl_l->content_type.ops->get_base_impl;
- content_type->ops->get_values =
- content_type_impl_l->content_type.ops->get_values;
-
- return axis2_xml_schema_enum_resolve_methods(&(content_type->base),
- env, content_type_impl_l->schema_enum, methods);
-}
-
axis2_array_list_t* AXIS2_CALL
axis2_xml_schema_content_type_get_values(void *content_type,
axis2_env_t **env)
{
+/* axis2_xml_schema_content_type_impl_t *schema_impl = NULL;
+ axis2_hash_t *super = NULL;
+ super = AXIS2_XML_SCHEMA_CONTENT_TYPE_SUPER_OBJS(content_type, env);
+ if(NULL != super)
+ schema_impl = axis2_hash_get(super,
+ "AXIS2_XML_SCHEMA_CONTENT_TYPE", AXIS2_HASH_KEY_STRING); */
return AXIS2_INTF_TO_IMPL(content_type)->members;
}
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_content_type_type(void *content_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(content_type)->obj_type;
+}
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_content_type_super_objs(void *content_type,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(content_type)->ht_super;
+}
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c Mon May 15 02:31:10 2006
@@ -28,14 +28,30 @@
struct axis2_xml_schema_derivation_method_impl
{
axis2_xml_schema_derivation_method_t derivation_method;
+
axis2_xml_schema_enum_t *schema_enum;
+
axis2_hash_t *methods;
+
+ axis2_xml_schema_types_t type;
+
axis2_array_list_t *members;
+
+ axis2_hash_t *ht_super;
};
#define AXIS2_INTF_TO_IMPL(derivation_method) \
((axis2_xml_schema_derivation_method_impl_t *) derivation_method)
+/************************* function prototypes ************************************/
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_derivation_method_super_objs(void *derivation_method,
+ axis2_env_t **env);
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_derivation_method_type(void *derivation_method,
+ axis2_env_t **env);
+
axis2_status_t AXIS2_CALL
axis2_xml_schema_derivation_method_free(void *derivation_method,
axis2_env_t **env);
@@ -44,18 +60,13 @@
axis2_xml_schema_derivation_method_get_base_impl(void *derivation_method,
axis2_env_t **env);
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_schema_derivation_method_resolve_methods(
- axis2_xml_schema_derivation_method_t *derivation_method,
- axis2_env_t **env,
- axis2_xml_schema_derivation_method_t *derivation_method_impl,
- axis2_hash_t *methods);
-
axis2_array_list_t * AXIS2_CALL
axis2_xml_schema_derivation_method_get_values(void *derivation_method,
axis2_env_t **env);
+/************************** end function prototypes ********************************/
+
AXIS2_DECLARE(axis2_xml_schema_derivation_method_t *)
axis2_xml_schema_derivation_method_create(axis2_env_t **env,
axis2_char_t *value)
@@ -74,6 +85,8 @@
derivation_method_impl->schema_enum = NULL;
derivation_method_impl->methods = NULL;
derivation_method_impl->members = NULL;
+ derivation_method_impl->ht_super = NULL;
+ derivation_method_impl->type = AXIS2_XML_SCHEMA_DERIVATION_METHOD;
derivation_method_impl->derivation_method.base.ops = NULL;
derivation_method_impl->derivation_method.ops = NULL;
@@ -93,7 +106,11 @@
axis2_xml_schema_derivation_method_get_base_impl;
derivation_method_impl->derivation_method.ops->get_values =
axis2_xml_schema_derivation_method_get_values;
-
+ derivation_method_impl->derivation_method.ops->super_objs =
+ axis2_xml_schema_derivation_method_super_objs;
+ derivation_method_impl->derivation_method.ops->type =
+ axis2_xml_schema_derivation_method_type;
+
derivation_method_impl->members = axis2_array_list_create(env, 0);
if(!derivation_method_impl->members)
@@ -103,28 +120,28 @@
return NULL;
}
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("all", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_ALL, env));
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("empty", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_EMPTY, env));
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("extension", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_EXTENSION, env));
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("list", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_LIST, env));
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("none", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_NONE, env));
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("restriction", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_RESTRICTION, env));
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("substitution", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_SUBSTITUTION, env));
AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env,
- AXIS2_STRDUP("union", env));
+ AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_UNION, env));
derivation_method_impl->methods = axis2_hash_make(env);
@@ -141,7 +158,13 @@
axis2_hash_set(derivation_method_impl->methods, "get_values", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_derivation_method_get_values);
-
+
+ axis2_hash_set(derivation_method_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_derivation_method_super_objs);
+
+ axis2_hash_set(derivation_method_impl->methods, "type", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_derivation_method_type);
+
derivation_method_impl->schema_enum =
axis2_xml_schema_enum_create(env, value);
if(!derivation_method_impl->schema_enum)
@@ -151,6 +174,13 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
+ derivation_method_impl->ht_super = axis2_hash_make(env);
+ axis2_hash_set(derivation_method_impl->ht_super, "AXIS2_XML_SCHEMA_DERIVATION_METHOD",
+ AXIS2_HASH_KEY_STRING, &(derivation_method_impl->derivation_method));
+
+ axis2_hash_set(derivation_method_impl->ht_super, "AXIS2_XML_SCHEMA_ENUM",
+ AXIS2_HASH_KEY_STRING, derivation_method_impl->schema_enum);
status = axis2_xml_schema_enum_resolve_methods(
&(derivation_method_impl->derivation_method.base),
env, derivation_method_impl->schema_enum,
@@ -223,42 +253,35 @@
return derivation_method_impl->schema_enum;
}
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_schema_derivation_method_resolve_methods(
- axis2_xml_schema_derivation_method_t *derivation_method,
- axis2_env_t **env,
- axis2_xml_schema_derivation_method_t *derivation_method_impl,
- axis2_hash_t *methods)
-{
- axis2_xml_schema_derivation_method_impl_t *derivation_method_impl_l = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, derivation_method_impl, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-
- derivation_method_impl_l = (axis2_xml_schema_derivation_method_impl_t *) derivation_method_impl;
-
- derivation_method->ops = AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_xml_schema_derivation_method_ops_t));
- if(!derivation_method->ops)
- {
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return AXIS2_FAILURE;
- }
- derivation_method->ops->free = axis2_hash_get(methods, "free",
- AXIS2_HASH_KEY_STRING);
- derivation_method->ops->get_base_impl =
- derivation_method_impl_l->derivation_method.ops->get_base_impl;
- derivation_method->ops->get_values =
- derivation_method_impl_l->derivation_method.ops->get_values;
-
- return axis2_xml_schema_enum_resolve_methods(&(derivation_method->base),
- env, derivation_method_impl_l->schema_enum, methods);
-}
-
axis2_array_list_t *AXIS2_CALL
axis2_xml_schema_derivation_method_get_values(void *derivation_method,
axis2_env_t **env)
{
+/*
+ axis2_xml_schema_derivation_method_impl_t *deri_impl = NULL;
+ axis2_hash_t *ht_super = NULL;
+ ht_super = AXIS2_XML_SCHEMA_DERIVATION_METHOD_SUPER_OBJS(derivation_method, env);
+ if(NULL != ht_super)
+ {
+ deri_impl = (axis2_xml_schema_derivation_method_impl_t*)
+ axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_DERIVATION_METHOD", AXIS2_HASH_KEY_STRING);
+ if(NULL != deri_impl)
+ return deri_impl->members;
+ }
+*/
return AXIS2_INTF_TO_IMPL(derivation_method)->members;
}
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_schema_derivation_method_super_objs(void *derivation_method,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(derivation_method)->ht_super;
+}
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_derivation_method_type(void *derivation_method,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(derivation_method)->type;
+}
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_documentation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_documentation.c?rev=406594&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_documentation.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_documentation.c Mon May 15 02:31:10 2006
@@ -0,0 +1,366 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <xml_schema/axis2_xml_schema_documentation.h>
+#include <xml_schema/axis2_xml_schema_use.h>
+
+typedef struct axis2_xml_schema_documentation_impl
+ axis2_xml_schema_documentation_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_documentation_impl
+{
+ axis2_xml_schema_documentation_t documentation;
+
+ axis2_xml_schema_obj_t *schema_obj;
+
+ axis2_xml_schema_types_t obj_type;
+
+ axis2_hash_t *ht_super;
+
+ axis2_hash_t *methods;
+
+ axis2_char_t *source;
+
+ void *markup; /* TODO Replace (void *) with node list */
+};
+
+#define AXIS2_INTF_TO_IMPL(documentation) \
+ ((axis2_xml_schema_documentation_impl_t *) documentation)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_documentation_free(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_documentation_super_objs(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_documentation_type(
+ void *documentation,
+ axis2_env_t **env);
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_documentation_get_base_impl(void *documentation,
+ axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_documentation_get_source(void *documentation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_documentation_set_source(void *documentation,
+ axis2_env_t **env,
+ axis2_char_t *source);
+
+/* TODO replace (void *) mark up with node list */
+void *AXIS2_CALL
+axis2_xml_schema_documentation_get_markup(void *documentation,
+ axis2_env_t **env);
+
+/* TODO replace (void *) mark up with node list */
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_documentation_set_markup(void *documentation,
+ axis2_env_t **env,
+ void *markup);
+/****************** end macros ***********************************************/
+
+AXIS2_DECLARE(axis2_xml_schema_documentation_t *)
+axis2_xml_schema_documentation_create(axis2_env_t **env)
+{
+ axis2_xml_schema_documentation_impl_t *documentation_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ documentation_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_documentation_impl_t));
+ if(!documentation_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error , AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ documentation_impl->schema_obj = NULL;
+ documentation_impl->documentation.base.ops = NULL;
+ documentation_impl->documentation.ops = NULL;
+ documentation_impl->obj_type = AXIS2_XML_SCHEMA_APP_INFO;
+ documentation_impl->ht_super = NULL;
+ documentation_impl->methods = NULL;
+ documentation_impl->source = NULL;
+ documentation_impl->markup = NULL;
+
+ documentation_impl->documentation.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_documentation_ops_t));
+
+ if(!documentation_impl->documentation.ops)
+ {
+ axis2_xml_schema_documentation_free(&(documentation_impl->documentation), env);
+ AXIS2_ERROR_SET((*env)->error , AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ documentation_impl->documentation.ops->free =
+ axis2_xml_schema_documentation_free;
+
+ documentation_impl->documentation.ops->super_objs =
+ axis2_xml_schema_documentation_super_objs;
+
+ documentation_impl->documentation.ops->type =
+ axis2_xml_schema_documentation_type;
+
+ documentation_impl->documentation.ops->get_base_impl =
+ axis2_xml_schema_documentation_get_base_impl;
+
+ documentation_impl->documentation.ops->get_source =
+ axis2_xml_schema_documentation_get_source;
+
+ documentation_impl->documentation.ops->set_source =
+ axis2_xml_schema_documentation_set_source;
+
+ documentation_impl->documentation.ops->get_markup =
+ axis2_xml_schema_documentation_get_markup;
+
+ documentation_impl->documentation.ops->set_markup =
+ axis2_xml_schema_documentation_set_markup;
+
+ documentation_impl->methods = axis2_hash_make(env);
+ if(!documentation_impl->methods)
+ {
+ axis2_xml_schema_documentation_free(&(documentation_impl->documentation), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(documentation_impl->methods, "free",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_documentation_free);
+
+ axis2_hash_set(documentation_impl->methods, "super_objs",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_documentation_super_objs);
+
+ axis2_hash_set(documentation_impl->methods, "type",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_documentation_type);
+
+ axis2_hash_set(documentation_impl->methods, "get_source",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_documentation_get_source);
+
+ axis2_hash_set(documentation_impl->methods, "set_source",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_documentation_set_source);
+
+ axis2_hash_set(documentation_impl->methods, "get_markup",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_documentation_get_markup);
+
+ axis2_hash_set(documentation_impl->methods, "set_markup",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_documentation_set_markup);
+
+ documentation_impl->schema_obj = axis2_xml_schema_obj_create(env);
+ if(!documentation_impl->schema_obj)
+ {
+ axis2_xml_schema_documentation_free(&(documentation_impl->documentation), env);
+ return NULL;
+ }
+
+ documentation_impl->ht_super = axis2_hash_make(env);
+
+ if(!documentation_impl->ht_super)
+ {
+ axis2_xml_schema_documentation_free(&(documentation_impl->documentation), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(documentation_impl->ht_super, "AXIS2_XML_SCHEMA_DOCUMENTATION",
+ AXIS2_HASH_KEY_STRING, &(documentation_impl->documentation));
+
+ axis2_hash_set(documentation_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ",
+ AXIS2_HASH_KEY_STRING, documentation_impl->schema_obj);
+
+ status = axis2_xml_schema_obj_resolve_methods(&(documentation_impl->documentation.base),
+ env, documentation_impl->schema_obj, documentation_impl->methods);
+ return &(documentation_impl->documentation);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_documentation_free(void *documentation,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_documentation_impl_t *documentation_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ documentation_impl = AXIS2_INTF_TO_IMPL(documentation);
+
+ if(NULL != documentation_impl->source)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->source);
+ documentation_impl->source = NULL;
+ }
+
+ /* TODO Free markup */
+
+ if(NULL != documentation_impl->ht_super)
+ {
+ axis2_hash_free(documentation_impl->ht_super, env);
+ documentation_impl->ht_super = NULL;
+ }
+
+ if(NULL != documentation_impl->methods)
+ {
+ axis2_hash_free(documentation_impl->methods, env);
+ documentation_impl->methods = NULL;
+ }
+
+ if(NULL != documentation_impl->schema_obj)
+ {
+ AXIS2_XML_SCHEMA_OBJ_FREE(documentation_impl->schema_obj, env);
+ documentation_impl->schema_obj = NULL;
+ }
+
+ if(NULL != documentation_impl->documentation.ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.ops);
+ documentation_impl->documentation.ops = NULL;
+ }
+ if(NULL != documentation_impl->documentation.base.ops)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->documentation.base.ops);
+ documentation_impl->documentation.base.ops = NULL;
+ }
+ if(NULL != documentation_impl)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl);
+ documentation_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_documentation_super_objs(
+ void *documentation,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(documentation)->ht_super;
+}
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_documentation_type(
+ void *documentation,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(documentation)->obj_type;
+}
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_documentation_get_base_impl(
+ void *documentation,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(documentation)->schema_obj;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_documentation_get_source(void *documentation,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_documentation_impl_t *documentation_impl = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(documentation, env);
+ if(NULL != ht_super)
+ {
+ documentation_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
+ AXIS2_HASH_KEY_STRING));
+ if(NULL != documentation_impl)
+ return documentation_impl->source;
+ }
+
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_documentation_set_source(void *documentation,
+ axis2_env_t **env,
+ axis2_char_t *source)
+{
+ axis2_xml_schema_documentation_impl_t *documentation_impl = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, source, AXIS2_FAILURE);
+
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(documentation, env);
+ if(NULL != ht_super)
+ {
+ documentation_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
+ AXIS2_HASH_KEY_STRING));
+ if(NULL != documentation_impl)
+ return AXIS2_FAILURE;
+ }
+
+ if(NULL != documentation_impl->source)
+ {
+ AXIS2_FREE((*env)->allocator, documentation_impl->source);
+ documentation_impl->source = NULL;
+ }
+
+ documentation_impl->source = AXIS2_STRDUP(source, env);
+ if(!documentation_impl->source)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_SUCCESS;
+}
+
+/* TODO replace (void *) mark up with node list */
+void *AXIS2_CALL
+axis2_xml_schema_documentation_get_markup(void *documentation,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_documentation_impl_t *documentation_impl = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(documentation, env);
+ if(NULL != ht_super)
+ {
+ documentation_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
+ AXIS2_HASH_KEY_STRING));
+ if(NULL != documentation_impl)
+ return NULL;
+ }
+ return documentation_impl->markup;
+}
+
+/* TODO replace (void *) mark up with node list */
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_documentation_set_markup(void *documentation,
+ axis2_env_t **env,
+ void *markup)
+{
+ axis2_xml_schema_documentation_impl_t *documentation_impl = NULL;
+ axis2_hash_t *ht_super = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, markup, AXIS2_FAILURE);
+ ht_super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(documentation, env);
+ if(NULL != ht_super)
+ {
+ documentation_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, "AXIS2_XML_SCHEMA_APP_INFO",
+ AXIS2_HASH_KEY_STRING));
+ if(NULL != documentation_impl)
+ return AXIS2_FAILURE;
+ }
+ documentation_impl->markup = markup;
+ return AXIS2_SUCCESS;
+}
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c Mon May 15 02:31:10 2006
@@ -102,6 +102,10 @@
* QName of an element that can be a substitute for this element.
*/
axis2_qname_t *substitution_group;
+
+ axis2_hash_t *ht_super;
+
+ axis2_xml_schema_types_t obj_type;
};
@@ -111,10 +115,17 @@
axis2_xml_schema_element_free(void *element,
axis2_env_t **env);
-axis2_xml_schema_type_receiver_t *AXIS2_CALL
+axis2_xml_schema_particle_t *AXIS2_CALL
axis2_xml_schema_element_get_base_impl(void *element,
axis2_env_t **env);
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_element_type(void *element,
+ axis2_env_t **env);
+
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_element_super_objs(void *element,
+ axis2_env_t **env);
/**
* Returns a collection of constraints on the element.
*/
@@ -262,7 +273,7 @@
{
axis2_xml_schema_element_impl_t *element_impl = NULL;
axis2_status_t status = AXIS2_FAILURE;
-
+ axis2_xml_schema_annotated_t *annotated = NULL;
element_impl = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_xml_schema_element_impl_t));
@@ -291,6 +302,8 @@
element_impl->type_recv = NULL;
element_impl->schema_type_qname = NULL;
element_impl->substitution_group = NULL;
+ element_impl->ht_super = NULL;
+ element_impl->obj_type = AXIS2_XML_SCHEMA_ELEMENT;
element_impl->element.ops = AXIS2_MALLOC((*env)->allocator,
@@ -299,6 +312,11 @@
element_impl->element.ops->free = axis2_xml_schema_element_free;
element_impl->element.ops->get_base_impl =
axis2_xml_schema_element_get_base_impl;
+ element_impl->element.ops->super_objs =
+ axis2_xml_schema_element_super_objs;
+ element_impl->element.ops->type =
+ axis2_xml_schema_element_type;
+
element_impl->element.ops->get_constraints =
axis2_xml_schema_element_get_constraints;
element_impl->element.ops->get_default_value =
@@ -372,6 +390,10 @@
axis2_xml_schema_element_free);
axis2_hash_set(element_impl->methods, "get_constraints", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_element_get_constraints);
+ axis2_hash_set(element_impl->methods, "type", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_element_type);
+ axis2_hash_set(element_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_element_super_objs);
axis2_hash_set(element_impl->methods, "get_default_value", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_element_get_default_value);
axis2_hash_set(element_impl->methods, "set_default_value", AXIS2_HASH_KEY_STRING,
@@ -435,9 +457,35 @@
axis2_hash_set(element_impl->methods, "set_type", AXIS2_HASH_KEY_STRING,
axis2_xml_schema_element_set_type);
- element_impl->type_recv = axis2_xml_schema_type_receiver_create(env);
- status = axis2_xml_schema_type_receiver_resolve_methods(
- &(element_impl->element.base), env, element_impl->type_recv,
+ /*element_impl->type_recv = axis2_xml_schema_type_receiver_create(env); */
+ element_impl->particle = axis2_xml_schema_particle_create(env);
+ if(!element_impl->particle)
+ {
+ axis2_xml_schema_element_free(&(element_impl->element), env);
+ return NULL;
+ }
+ element_impl->ht_super = axis2_hash_make(env);
+ if(!element_impl->ht_super)
+ {
+ axis2_xml_schema_element_free(&(element_impl->element), env);
+ return NULL;
+ }
+
+ axis2_hash_set(element_impl->ht_super, "AXIS2_XML_SCHEMA_ELEMENT",
+ AXIS2_HASH_KEY_STRING, &(element_impl->element));
+ axis2_hash_set(element_impl->ht_super, "AXIS2_XML_SCHEMA_PARTICLE",
+ AXIS2_HASH_KEY_STRING, element_impl->particle);
+
+ annotated = AXIS2_XML_SCHEMA_PARTICLE_GET_BASE_IMPL(element_impl->particle, env);
+ if(NULL != annotated)
+ {
+ axis2_hash_set(element_impl->ht_super, "AXIS2_XML_SCHEMA_ANNOTATED",
+ AXIS2_HASH_KEY_STRING, &(element_impl->element));
+ axis2_hash_set(element_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ",
+ AXIS2_HASH_KEY_STRING, AXIS2_XML_SCHEMA_ANNOTATED_GET_BASE_IMPL(annotated, env));
+ }
+ status = axis2_xml_schema_particle_resolve_methods(
+ &(element_impl->element.base), env, element_impl->particle,
element_impl->methods);
return &(element_impl->element);
@@ -484,7 +532,7 @@
return AXIS2_SUCCESS;
}
-axis2_xml_schema_type_receiver_t *AXIS2_CALL
+axis2_xml_schema_particle_t *AXIS2_CALL
axis2_xml_schema_element_get_base_impl(void *element,
axis2_env_t **env)
{
@@ -493,9 +541,11 @@
AXIS2_ENV_CHECK(env, NULL);
element_impl = AXIS2_INTF_TO_IMPL(element);
- return element_impl->type_recv;
+ return element_impl->particle;
}
+/*
+
AXIS2_DECLARE(axis2_status_t)
axis2_xml_schema_element_resolve_methods(
axis2_xml_schema_element_t *element,
@@ -583,7 +633,7 @@
return axis2_xml_schema_type_receiver_resolve_methods(&(element->base),
env, element_impl_l->type_recv, methods);
}
-
+*/
/**
* Returns a collection of constraints on the element.
@@ -682,7 +732,7 @@
axis2_xml_schema_element_get_fixed_value(void *element,
axis2_env_t **env)
{
- return NULL;
+ return AXIS2_INTF_TO_IMPL(element)->fixed_value;
}
axis2_status_t AXIS2_CALL
@@ -690,6 +740,15 @@
axis2_env_t **env,
axis2_char_t *fixed_value)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->fixed_value)
+ {
+ AXIS2_FREE((*env)->allocator, element_impl->fixed_value);
+ element_impl->fixed_value = NULL;
+ }
+ element_impl->fixed_value = AXIS2_STRDUP(fixed_value, env);
return AXIS2_SUCCESS;
}
@@ -704,7 +763,15 @@
axis2_xml_schema_element_get_form(void *element,
axis2_env_t **env)
{
- return NULL;
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->form)
+ {
+ AXIS2_XML_SCHEMA_FORM_FREE(element_impl->form, env);
+ element_impl->form = NULL;
+ }
+ return element_impl->form;
}
axis2_status_t AXIS2_CALL
@@ -712,6 +779,15 @@
axis2_env_t **env,
axis2_xml_schema_form_t *form)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->form)
+ {
+ AXIS2_XML_SCHEMA_FORM_FREE(element_impl->form, env);
+ element_impl->block = NULL;
+ }
+ element_impl->form = element_impl->form;
return AXIS2_SUCCESS;
}
@@ -719,7 +795,7 @@
axis2_xml_schema_element_is_abstract(void *element,
axis2_env_t **env)
{
- return AXIS2_TRUE;
+ return AXIS2_INTF_TO_IMPL(element)->is_abstract;
}
axis2_status_t AXIS2_CALL
@@ -727,6 +803,10 @@
axis2_env_t **env,
axis2_bool_t is_abstract)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ element_impl->is_abstract = is_abstract;
return AXIS2_SUCCESS;
}
@@ -734,22 +814,26 @@
axis2_xml_schema_element_is_nillable(void *element,
axis2_env_t **env)
{
- return AXIS2_TRUE;
+ return AXIS2_INTF_TO_IMPL(element)->is_nillable;
}
axis2_status_t AXIS2_CALL
axis2_xml_schema_element_set_nillable(void *element,
axis2_env_t **env,
- axis2_bool_t is_nillable)
+ axis2_bool_t nillable)
{
- return AXIS2_SUCCESS;
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ element_impl->is_nillable = nillable;
+ return AXIS2_SUCCESS;
}
axis2_char_t *AXIS2_CALL
axis2_xml_schema_element_get_name(void *element,
axis2_env_t **env)
{
- return NULL;
+ return AXIS2_INTF_TO_IMPL(element)->name;
}
axis2_status_t AXIS2_CALL
@@ -757,6 +841,15 @@
axis2_env_t **env,
axis2_char_t *name)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->name)
+ {
+ AXIS2_FREE((*env)->allocator, element_impl->name);
+ element_impl->name = NULL;
+ }
+ element_impl->name = AXIS2_STRDUP(name, env);
return AXIS2_SUCCESS;
}
@@ -764,7 +857,7 @@
axis2_xml_schema_element_get_ref_qname(void *element,
axis2_env_t **env)
{
- return NULL;
+ return AXIS2_INTF_TO_IMPL(element)->ref_qname;
}
axis2_status_t AXIS2_CALL
@@ -772,6 +865,15 @@
axis2_env_t **env,
axis2_qname_t *ref_qname)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->ref_qname)
+ {
+ AXIS2_QNAME_FREE(element_impl->ref_qname, env);
+ element_impl->ref_qname = NULL;
+ }
+ element_impl->ref_qname = ref_qname;
return AXIS2_SUCCESS;
}
@@ -779,7 +881,7 @@
axis2_xml_schema_element_get_qname(void *element,
axis2_env_t **env)
{
- return NULL;
+ return AXIS2_INTF_TO_IMPL(element)->qualified_qname;
}
axis2_status_t AXIS2_CALL
@@ -787,6 +889,15 @@
axis2_env_t **env,
axis2_qname_t *qualified_name)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->qualified_qname)
+ {
+ AXIS2_QNAME_FREE(element_impl->qualified_qname, env);
+ element_impl->qualified_qname = NULL;
+ }
+ element_impl->qualified_qname = qualified_name;
return AXIS2_SUCCESS;
}
@@ -794,14 +905,23 @@
axis2_xml_schema_element_get_schema_type(void *element,
axis2_env_t **env)
{
- return NULL;
+ return AXIS2_INTF_TO_IMPL(element)->schema_type;
+
}
axis2_status_t AXIS2_CALL
axis2_xml_schema_element_set_schema_type(void *element,
- axis2_env_t **env,
- axis2_xml_schema_type_t *schema_type)
+ axis2_env_t **env,
+ axis2_xml_schema_type_t *schema_type)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->schema_type)
+ {
+ /** TODO free */
+ }
+ element_impl->schema_type = schema_type;
return AXIS2_SUCCESS;
}
@@ -809,22 +929,31 @@
axis2_xml_schema_element_get_schema_type_qname(void *element,
axis2_env_t **env)
{
- return NULL;
+ return AXIS2_INTF_TO_IMPL(element)->schema_type_qname;
}
axis2_status_t AXIS2_CALL
-axis2_xml_schema_element_set_schema_type_qname(void *element,
- axis2_env_t **env,
- axis2_qname_t *schema_type_qname)
+axis2_xml_schema_element_set_schema_type_qname(
+ void *element,
+ axis2_env_t **env,
+ axis2_qname_t *schema_type_qname)
{
- return AXIS2_SUCCESS;
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->schema_type_qname)
+ {
+ /** TODO free */
+ }
+ element_impl->schema_type_qname = schema_type_qname;
+ return AXIS2_SUCCESS;
}
axis2_qname_t *AXIS2_CALL
axis2_xml_schema_element_get_substitution_group(void *element,
axis2_env_t **env)
{
- return NULL;
+ return AXIS2_INTF_TO_IMPL(element)->substitution_group;
}
axis2_status_t AXIS2_CALL
@@ -832,6 +961,14 @@
axis2_env_t **env,
axis2_qname_t *substitution_group)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->substitution_group)
+ {
+ /** TODO free */
+ }
+ element_impl->substitution_group = substitution_group;
return AXIS2_SUCCESS;
}
@@ -841,6 +978,7 @@
axis2_char_t *prefix,
int tab)
{
+ /** TODO */
return NULL;
}
@@ -849,5 +987,27 @@
axis2_env_t **env,
axis2_xml_schema_type_t *type)
{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = AXIS2_INTF_TO_IMPL(element);
+ if(NULL != element_impl->schema_type)
+ {
+ /** TODO */
+ }
+ element_impl->schema_type = type;
return AXIS2_SUCCESS;
}
+
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_element_super_objs(void *element,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(element)->ht_super;
+}
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_element_type(void *element,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(element)->obj_type;
+}
\ No newline at end of file
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_enum.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_enum.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_enum.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_enum.c Mon May 15 02:31:10 2006
@@ -27,8 +27,10 @@
struct axis2_xml_schema_enum_impl
{
axis2_xml_schema_enum_t schema_enum;
+
axis2_xml_schema_types_t obj_type;
- axis2_hash_t *super;
+
+ axis2_hash_t *ht_super;
axis2_array_list_t *values;
@@ -71,6 +73,8 @@
axis2_xml_schema_enum_get_values(void *schema_enum,
axis2_env_t **env);
+/************************** function impl ************************************/
+
AXIS2_DECLARE(axis2_xml_schema_enum_t *)
axis2_xml_schema_enum_create(axis2_env_t **env,
axis2_char_t *value)
@@ -86,7 +90,7 @@
}
schema_enum_impl->obj_type = AXIS2_XML_SCHEMA_ENUM;
- schema_enum_impl->super = NULL;
+ schema_enum_impl->ht_super = NULL;
schema_enum_impl->values = NULL;
schema_enum_impl->value = NULL;
schema_enum_impl->schema_enum.ops = NULL;
@@ -125,14 +129,14 @@
schema_enum_impl->schema_enum.ops->get_values =
axis2_xml_schema_enum_get_values;
- schema_enum_impl->super = axis2_hash_make(env);
- if(!schema_enum_impl->super)
+ schema_enum_impl->ht_super = axis2_hash_make(env);
+ if(!schema_enum_impl->ht_super)
{
axis2_xml_schema_enum_free(&(schema_enum_impl->schema_enum), env);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- axis2_hash_set(schema_enum_impl->super, "AXIS2_XML_SCHEMA_ENUM",
+ axis2_hash_set(schema_enum_impl->ht_super, "AXIS2_XML_SCHEMA_ENUM",
AXIS2_HASH_KEY_STRING, &(schema_enum_impl->schema_enum));
return &(schema_enum_impl->schema_enum);
@@ -158,10 +162,10 @@
schema_enum_impl->values = NULL;
}
- if(NULL != schema_enum_impl->super)
+ if(NULL != schema_enum_impl->ht_super)
{
- axis2_hash_free(schema_enum_impl->super, env);
- schema_enum_impl->super = NULL;
+ axis2_hash_free(schema_enum_impl->ht_super, env);
+ schema_enum_impl->ht_super = NULL;
}
if(NULL != (&(schema_enum_impl->schema_enum))->ops)
@@ -184,11 +188,9 @@
axis2_env_t **env)
{
axis2_xml_schema_enum_impl_t *schema_enum_impl = NULL;
-
AXIS2_ENV_CHECK(env, NULL);
schema_enum_impl = AXIS2_INTF_TO_IMPL(schema_enum);
-
- return schema_enum_impl->super;
+ return schema_enum_impl->ht_super;
}
axis2_xml_schema_types_t AXIS2_CALL
@@ -197,10 +199,8 @@
axis2_env_t **env)
{
axis2_xml_schema_enum_impl_t *schema_enum_impl = NULL;
-
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
schema_enum_impl = AXIS2_INTF_TO_IMPL(schema_enum);
-
return schema_enum_impl->obj_type;
}
@@ -334,7 +334,7 @@
return schema_enum_impl->values;
}
-int AXIS2_CALL
+AXIS2_DECLARE(int)
axis2_xml_schema_enum_index(axis2_char_t *value,
axis2_env_t **env,
axis2_array_list_t *values)