You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2006/04/28 14:28:56 UTC
svn commit: r397881 [2/2] - in /webservices/axis2/trunk/c:
include/xml_schema/ modules/xml/om/ modules/xml/xml_schema/
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_list.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_list.c?rev=397881&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_list.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_list.c Fri Apr 28 05:28:53 2006
@@ -0,0 +1,310 @@
+/*
+ * 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 <axis2_xml_schema_simple_type_list.h>
+
+typedef struct axis2_xml_schema_simple_type_list_impl
+ axis2_xml_schema_simple_type_list_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_simple_type_list_impl
+{
+ axis2_xml_schema_simple_type_list_t simple_type_list;
+
+ axis2_xml_schema_simple_type_content_t *sim_type_content;
+
+ axis2_hash_t *methods;
+
+ axis2_xml_schema_simple_type_t *item_type;
+
+ axis2_qname_t *item_type_name;
+
+};
+
+#define AXIS2_INTF_TO_IMPL(simple_type_list) \
+ ((axis2_xml_schema_simple_type_list_impl_t *) simple_type_list)
+
+/*************** function prototypes *****************************************/
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_list_free(void *simple_type_list,
+ axis2_env_t **env);
+
+axis2_xml_schema_simple_type_content_t *AXIS2_CALL
+axis2_xml_schema_simple_type_list_get_base_impl(void *simple_type_list,
+ axis2_env_t **env);
+
+axis2_xml_schema_simple_type_t* AXIS2_CALL
+axis2_xml_schema_simple_type_list_get_item_type(void *simple_type_list,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_list_set_item_type(void *simple_type_list,
+ axis2_env_t **env,
+ axis2_xml_schema_simple_type_t *base_type);
+
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_simple_type_list_get_item_type_name(void *simple_type_list,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_list_set_item_type_name(void *simple_type_list,
+ axis2_env_t **env,
+ axis2_qname_t *base_type_name);
+
+/*************** function prototypes *****************************************/
+
+AXIS2_DECLARE(axis2_xml_schema_simple_type_list_t *)
+axis2_xml_schema_simple_type_list_create(axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_list_impl_t *simple_type_list_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ simple_type_list_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_list_impl_t));
+
+ if(!simple_type_list_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ simple_type_list_impl->sim_type_content = NULL;
+ simple_type_list_impl->simple_type_list.ops = NULL;
+ simple_type_list_impl->simple_type_list.base.ops = NULL;
+ simple_type_list_impl->methods = NULL;
+ simple_type_list_impl->item_type = NULL;
+ simple_type_list_impl->item_type_name = NULL;
+
+
+ simple_type_list_impl->simple_type_list.ops =
+ AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_list_ops_t));
+
+ if(!simple_type_list_impl->simple_type_list.ops)
+ {
+ axis2_xml_schema_simple_type_list_free(
+ &(simple_type_list_impl->simple_type_list), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ simple_type_list_impl->simple_type_list.ops->free =
+ axis2_xml_schema_simple_type_list_free;
+ simple_type_list_impl->simple_type_list.ops->get_base_impl =
+ axis2_xml_schema_simple_type_list_get_base_impl;
+ simple_type_list_impl->simple_type_list.ops->get_item_type =
+ axis2_xml_schema_simple_type_list_get_item_type;
+ simple_type_list_impl->simple_type_list.ops->set_item_type =
+ axis2_xml_schema_simple_type_list_set_item_type;
+ simple_type_list_impl->simple_type_list.ops->get_item_type_name =
+ axis2_xml_schema_simple_type_list_get_item_type_name;
+ simple_type_list_impl->simple_type_list.ops->set_item_type_name =
+ axis2_xml_schema_simple_type_list_set_item_type_name;
+
+ simple_type_list_impl->methods = axis2_hash_make(env);
+ if(!simple_type_list_impl->methods)
+ {
+ axis2_xml_schema_simple_type_list_free(&(simple_type_list_impl->simple_type_list), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(simple_type_list_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_simple_type_list_free);
+ axis2_hash_set(simple_type_list_impl->methods, "get_base_type",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_list_get_item_type);
+ axis2_hash_set(simple_type_list_impl->methods, "set_base_type",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_list_set_item_type);
+ axis2_hash_set(simple_type_list_impl->methods, "get_base_type_name",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_list_get_item_type_name);
+ axis2_hash_set(simple_type_list_impl->methods, "set_base_type_name",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_list_set_item_type_name);
+
+ simple_type_list_impl->sim_type_content =
+ axis2_xml_schema_simple_type_content_create(env);
+
+ if(!simple_type_list_impl->sim_type_content)
+ {
+ axis2_xml_schema_simple_type_list_free(
+ &(simple_type_list_impl->simple_type_list), env);
+ return NULL;
+ }
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_SET_TYPE(
+ simple_type_list_impl->sim_type_content, env,
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_LIST);
+
+ status = axis2_xml_schema_simple_type_content_resolve_methods(
+ &(simple_type_list_impl->simple_type_list.base), env, simple_type_list_impl->sim_type_content,
+ simple_type_list_impl->methods);
+
+ return &(simple_type_list_impl->simple_type_list);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_list_free(void *simple_type_list,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_list_impl_t *simple_type_list_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ simple_type_list_impl = AXIS2_INTF_TO_IMPL(simple_type_list);
+
+ if(NULL != simple_type_list_impl->methods)
+ {
+ axis2_hash_free(simple_type_list_impl->methods, env);
+ simple_type_list_impl->methods = NULL;
+ }
+
+ if(NULL != simple_type_list_impl->sim_type_content)
+ {
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_FREE(
+ simple_type_list_impl->sim_type_content , env);
+ simple_type_list_impl->sim_type_content = NULL;
+ }
+
+ if(NULL != simple_type_list_impl->simple_type_list.ops)
+ {
+ AXIS2_FREE((*env)->allocator,
+ simple_type_list_impl->simple_type_list.ops);
+ simple_type_list_impl->simple_type_list.ops = NULL;
+ }
+ if(NULL != simple_type_list_impl->simple_type_list.base.ops)
+ {
+ AXIS2_FREE((*env)->allocator,
+ simple_type_list_impl->simple_type_list.base.ops);
+ simple_type_list_impl->simple_type_list.base.ops = NULL;
+ }
+
+ if(NULL != simple_type_list_impl)
+ {
+ AXIS2_FREE((*env)->allocator, simple_type_list_impl);
+ simple_type_list_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_simple_type_content_t *AXIS2_CALL
+axis2_xml_schema_simple_type_list_get_base_impl(void *simple_type_list,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_list_impl_t *simple_type_list_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ simple_type_list_impl = AXIS2_INTF_TO_IMPL(simple_type_list);
+
+ return simple_type_list_impl->sim_type_content;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_simple_type_list_resolve_methods(
+ axis2_xml_schema_simple_type_list_t *simple_type_list,
+ axis2_env_t **env,
+ axis2_xml_schema_simple_type_list_t *simple_type_list_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_simple_type_list_impl_t *simple_type_list_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, simple_type_list_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ simple_type_list_impl_l =
+ (axis2_xml_schema_simple_type_list_impl_t *) simple_type_list_impl;
+
+ simple_type_list->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_list_ops_t));
+ if(NULL != simple_type_list->ops)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+
+ simple_type_list->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ simple_type_list->ops->get_base_impl =
+ simple_type_list_impl_l->simple_type_list.ops->get_base_impl;
+
+ simple_type_list->ops->get_item_type =
+ simple_type_list_impl_l->simple_type_list.ops->get_item_type;
+
+ simple_type_list->ops->set_item_type =
+ simple_type_list_impl_l->simple_type_list.ops->set_item_type;
+
+ simple_type_list->ops->get_item_type_name =
+ simple_type_list_impl_l->simple_type_list.ops->get_item_type_name;
+ simple_type_list->ops->set_item_type_name =
+ simple_type_list_impl_l->simple_type_list.ops->set_item_type_name;
+
+ return axis2_xml_schema_simple_type_content_resolve_methods(
+ &(simple_type_list->base), env,
+ simple_type_list_impl_l->sim_type_content, methods);
+}
+
+axis2_xml_schema_simple_type_t* AXIS2_CALL
+axis2_xml_schema_simple_type_list_get_item_type(void *simple_type_list,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return
+ AXIS2_INTF_TO_IMPL(simple_type_list)->item_type;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_list_set_item_type(void *simple_type_list,
+ axis2_env_t **env,
+ axis2_xml_schema_simple_type_t* item_type)
+{
+ axis2_xml_schema_simple_type_list_impl_t *sim_type_res_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ sim_type_res_impl = AXIS2_INTF_TO_IMPL(simple_type_list);
+ if(NULL != sim_type_res_impl->item_type_name)
+ {
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_FREE(sim_type_res_impl->item_type, env);
+ sim_type_res_impl->item_type_name = NULL;
+ }
+ sim_type_res_impl->item_type = item_type;
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_simple_type_list_get_item_type_name(void *simple_type_list,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return AXIS2_INTF_TO_IMPL(simple_type_list)->item_type_name;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_list_set_item_type_name(void *simple_type_list,
+ axis2_env_t **env,
+ axis2_qname_t *item_type_name)
+{
+ axis2_xml_schema_simple_type_list_impl_t *sim_type_res_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, item_type_name, AXIS2_FAILURE);
+
+ sim_type_res_impl = AXIS2_INTF_TO_IMPL(simple_type_list);
+ if(NULL != sim_type_res_impl->item_type_name)
+ {
+ AXIS2_QNAME_FREE(sim_type_res_impl->item_type_name, env);
+ sim_type_res_impl->item_type_name = NULL;
+ }
+ sim_type_res_impl->item_type_name = item_type_name;
+ return AXIS2_SUCCESS;
+}
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_restriction.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_restriction.c?rev=397881&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_restriction.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_restriction.c Fri Apr 28 05:28:53 2006
@@ -0,0 +1,335 @@
+/*
+ * 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 <axis2_xml_schema_simple_type_restriction.h>
+#include <axis2_xml_schema_obj_collection.h>
+
+typedef struct axis2_xml_schema_simple_type_restriction_impl
+ axis2_xml_schema_simple_type_restriction_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_simple_type_restriction_impl
+{
+ axis2_xml_schema_simple_type_restriction_t simple_type_restriction;
+
+ axis2_xml_schema_simple_type_content_t *sim_type_content;
+
+ axis2_hash_t *methods;
+
+ axis2_xml_schema_simple_type_t *base_type;
+
+ axis2_qname_t *base_type_name;
+
+ axis2_xml_schema_obj_collection_t *facets;
+
+};
+
+#define AXIS2_INTF_TO_IMPL(simple_type_restriction) \
+ ((axis2_xml_schema_simple_type_restriction_impl_t *) simple_type_restriction)
+
+/*************** function prototypes *****************************************/
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_free(void *simple_type_restriction,
+ axis2_env_t **env);
+
+axis2_xml_schema_simple_type_content_t *AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_base_impl(void *simple_type_restriction,
+ axis2_env_t **env);
+
+axis2_xml_schema_simple_type_t* AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_base_type(void *simple_type_restriction,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_set_base_type(void *simple_type_restriction,
+ axis2_env_t **env,
+ axis2_xml_schema_simple_type_t *base_type);
+
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_base_type_name(void *simple_type_restriction,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_set_base_type_name(void *simple_type_restriction,
+ axis2_env_t **env,
+ axis2_qname_t *base_type_name);
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_facets(void *simple_type_restriction,
+ axis2_env_t **env);
+/*************** function prototypes *****************************************/
+
+AXIS2_DECLARE(axis2_xml_schema_simple_type_restriction_t *)
+axis2_xml_schema_simple_type_restriction_create(axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_restriction_impl_t *simple_type_restriction_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ simple_type_restriction_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_restriction_impl_t));
+
+ if(!simple_type_restriction_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ simple_type_restriction_impl->sim_type_content = NULL;
+ simple_type_restriction_impl->simple_type_restriction.ops = NULL;
+ simple_type_restriction_impl->simple_type_restriction.base.ops = NULL;
+ simple_type_restriction_impl->methods = NULL;
+ simple_type_restriction_impl->base_type = NULL;
+ simple_type_restriction_impl->base_type_name = NULL;
+ simple_type_restriction_impl->facets = NULL;
+
+
+ simple_type_restriction_impl->simple_type_restriction.ops =
+ AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_restriction_ops_t));
+
+ if(!simple_type_restriction_impl->simple_type_restriction.ops)
+ {
+ axis2_xml_schema_simple_type_restriction_free(
+ &(simple_type_restriction_impl->simple_type_restriction), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ simple_type_restriction_impl->simple_type_restriction.ops->free =
+ axis2_xml_schema_simple_type_restriction_free;
+ simple_type_restriction_impl->simple_type_restriction.ops->get_base_impl =
+ axis2_xml_schema_simple_type_restriction_get_base_impl;
+ simple_type_restriction_impl->simple_type_restriction.ops->get_base_type =
+ axis2_xml_schema_simple_type_restriction_get_base_type;
+ simple_type_restriction_impl->simple_type_restriction.ops->set_base_type =
+ axis2_xml_schema_simple_type_restriction_set_base_type;
+ simple_type_restriction_impl->simple_type_restriction.ops->get_base_type_name =
+ axis2_xml_schema_simple_type_restriction_get_base_type_name;
+ simple_type_restriction_impl->simple_type_restriction.ops->set_base_type_name =
+ axis2_xml_schema_simple_type_restriction_set_base_type_name;
+ simple_type_restriction_impl->simple_type_restriction.ops->get_facets =
+ axis2_xml_schema_simple_type_restriction_get_facets;
+
+
+ simple_type_restriction_impl->methods = axis2_hash_make(env);
+ if(!simple_type_restriction_impl->methods)
+ {
+ axis2_xml_schema_simple_type_restriction_free(&(simple_type_restriction_impl->simple_type_restriction), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(simple_type_restriction_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_simple_type_restriction_free);
+ axis2_hash_set(simple_type_restriction_impl->methods, "get_base_type",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_restriction_get_base_type);
+ axis2_hash_set(simple_type_restriction_impl->methods, "set_base_type",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_restriction_set_base_type);
+ axis2_hash_set(simple_type_restriction_impl->methods, "get_base_type_name",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_restriction_get_base_type_name);
+ axis2_hash_set(simple_type_restriction_impl->methods, "set_base_type_name",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_restriction_set_base_type_name);
+
+ simple_type_restriction_impl->sim_type_content =
+ axis2_xml_schema_simple_type_content_create(env);
+
+ if(!simple_type_restriction_impl->sim_type_content)
+ {
+ axis2_xml_schema_simple_type_restriction_free(
+ &(simple_type_restriction_impl->simple_type_restriction), env);
+ return NULL;
+ }
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_SET_TYPE(
+ simple_type_restriction_impl->sim_type_content, env,
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_RESTRICTION);
+
+ status = axis2_xml_schema_simple_type_content_resolve_methods(
+ &(simple_type_restriction_impl->simple_type_restriction.base), env, simple_type_restriction_impl->sim_type_content,
+ simple_type_restriction_impl->methods);
+
+ return &(simple_type_restriction_impl->simple_type_restriction);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_free(void *simple_type_restriction,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_restriction_impl_t *simple_type_restriction_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ simple_type_restriction_impl = AXIS2_INTF_TO_IMPL(simple_type_restriction);
+
+ if(NULL != simple_type_restriction_impl->methods)
+ {
+ axis2_hash_free(simple_type_restriction_impl->methods, env);
+ simple_type_restriction_impl->methods = NULL;
+ }
+
+ if(NULL != simple_type_restriction_impl->sim_type_content)
+ {
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_FREE(
+ simple_type_restriction_impl->sim_type_content , env);
+ simple_type_restriction_impl->sim_type_content = NULL;
+ }
+
+ if(NULL != simple_type_restriction_impl->simple_type_restriction.ops)
+ {
+ AXIS2_FREE((*env)->allocator,
+ simple_type_restriction_impl->simple_type_restriction.ops);
+ simple_type_restriction_impl->simple_type_restriction.ops = NULL;
+ }
+ if(NULL != simple_type_restriction_impl->simple_type_restriction.base.ops)
+ {
+ AXIS2_FREE((*env)->allocator,
+ simple_type_restriction_impl->simple_type_restriction.base.ops);
+ simple_type_restriction_impl->simple_type_restriction.base.ops = NULL;
+ }
+
+ if(NULL != simple_type_restriction_impl)
+ {
+ AXIS2_FREE((*env)->allocator, simple_type_restriction_impl);
+ simple_type_restriction_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_simple_type_content_t *AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_base_impl(void *simple_type_restriction,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_restriction_impl_t *simple_type_restriction_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ simple_type_restriction_impl = AXIS2_INTF_TO_IMPL(simple_type_restriction);
+
+ return simple_type_restriction_impl->sim_type_content;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_simple_type_restriction_resolve_methods(
+ axis2_xml_schema_simple_type_restriction_t *simple_type_restriction,
+ axis2_env_t **env,
+ axis2_xml_schema_simple_type_restriction_t *simple_type_restriction_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_simple_type_restriction_impl_t *simple_type_restriction_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, simple_type_restriction_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ simple_type_restriction_impl_l =
+ (axis2_xml_schema_simple_type_restriction_impl_t *) simple_type_restriction_impl;
+
+ simple_type_restriction->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_restriction_ops_t));
+ if(NULL != simple_type_restriction->ops)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+
+ simple_type_restriction->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ simple_type_restriction->ops->get_base_impl =
+ simple_type_restriction_impl_l->simple_type_restriction.ops->get_base_impl;
+
+ simple_type_restriction->ops->get_base_type =
+ simple_type_restriction_impl_l->simple_type_restriction.ops->get_base_type;
+
+ simple_type_restriction->ops->set_base_type =
+ simple_type_restriction_impl_l->simple_type_restriction.ops->set_base_type;
+
+ simple_type_restriction->ops->get_base_type_name =
+ simple_type_restriction_impl_l->simple_type_restriction.ops->get_base_type_name;
+ simple_type_restriction->ops->set_base_type_name =
+ simple_type_restriction_impl_l->simple_type_restriction.ops->set_base_type_name;
+
+ simple_type_restriction->ops->get_facets =
+ simple_type_restriction_impl_l->simple_type_restriction.ops->get_facets;
+
+ return axis2_xml_schema_simple_type_content_resolve_methods(
+ &(simple_type_restriction->base), env,
+ simple_type_restriction_impl_l->sim_type_content, methods);
+}
+
+axis2_xml_schema_simple_type_t* AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_base_type(void *simple_type_restriction,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return
+ AXIS2_INTF_TO_IMPL(simple_type_restriction)->base_type;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_set_base_type(void *simple_type_restriction,
+ axis2_env_t **env,
+ axis2_xml_schema_simple_type_t* base_type)
+{
+ axis2_xml_schema_simple_type_restriction_impl_t *sim_type_res_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ sim_type_res_impl = AXIS2_INTF_TO_IMPL(simple_type_restriction);
+ if(NULL != sim_type_res_impl->base_type_name)
+ {
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_FREE(sim_type_res_impl->base_type, env);
+ sim_type_res_impl->base_type_name = NULL;
+ }
+
+ sim_type_res_impl->base_type = base_type;
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t* AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_base_type_name(void *simple_type_restriction,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return AXIS2_INTF_TO_IMPL(simple_type_restriction)->base_type_name;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_set_base_type_name(void *simple_type_restriction,
+ axis2_env_t **env,
+ axis2_qname_t *base_type_name)
+{
+ axis2_xml_schema_simple_type_restriction_impl_t *sim_type_res_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, base_type_name, AXIS2_FAILURE);
+
+ sim_type_res_impl = AXIS2_INTF_TO_IMPL(simple_type_restriction);
+ if(NULL != sim_type_res_impl->base_type_name)
+ {
+ AXIS2_QNAME_FREE(sim_type_res_impl->base_type_name, env);
+ sim_type_res_impl->base_type_name = NULL;
+ }
+ sim_type_res_impl->base_type_name = base_type_name;
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_simple_type_restriction_get_facets(void *simple_type_restriction,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_restriction_impl_t *sim_type_res_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ sim_type_res_impl = AXIS2_INTF_TO_IMPL(simple_type_restriction);
+ return sim_type_res_impl->facets;
+}
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_union.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_union.c?rev=397881&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_union.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_union.c Fri Apr 28 05:28:53 2006
@@ -0,0 +1,315 @@
+/*
+ * 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 <axis2_xml_schema_simple_type_union.h>
+
+typedef struct axis2_xml_schema_simple_type_union_impl
+ axis2_xml_schema_simple_type_union_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_simple_type_union_impl
+{
+ axis2_xml_schema_simple_type_union_t simple_type_union;
+
+ axis2_xml_schema_simple_type_content_t *sim_type_content;
+
+ axis2_hash_t *methods;
+
+ axis2_char_t *member_types_source;
+
+ axis2_array_list_t *member_types_qnames;
+
+ axis2_xml_schema_obj_collection_t *base_types;
+};
+
+#define AXIS2_INTF_TO_IMPL(simple_type_union) \
+ ((axis2_xml_schema_simple_type_union_impl_t *) simple_type_union)
+
+/*************** function prototypes *****************************************/
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_union_free(void *simple_type_union,
+ axis2_env_t **env);
+
+axis2_xml_schema_simple_type_content_t *AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_base_impl(void *simple_type_union,
+ axis2_env_t **env);
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_base_types(void *simple_type_union,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_union_set_member_types_source(void *simple_type_union,
+ axis2_env_t **env,
+ axis2_char_t *member_types_source);
+
+axis2_char_t* AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_member_types_source
+ (void *simple_type_union,
+ axis2_env_t **env);
+
+axis2_array_list_t* AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_member_types_qnames(void *simple_type_union,
+ axis2_env_t **env);
+
+/*************** function prototypes *****************************************/
+
+AXIS2_DECLARE(axis2_xml_schema_simple_type_union_t *)
+axis2_xml_schema_simple_type_union_create(axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_union_impl_t *simple_type_union_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ simple_type_union_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_union_impl_t));
+
+ if(!simple_type_union_impl)
+ {
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ simple_type_union_impl->sim_type_content = NULL;
+ simple_type_union_impl->simple_type_union.ops = NULL;
+ simple_type_union_impl->simple_type_union.base.ops = NULL;
+ simple_type_union_impl->methods = NULL;
+ simple_type_union_impl->member_types_qnames = NULL;
+ simple_type_union_impl->member_types_source = NULL;
+
+ simple_type_union_impl->simple_type_union.ops =
+ AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_union_ops_t));
+
+ if(!simple_type_union_impl->simple_type_union.ops)
+ {
+ axis2_xml_schema_simple_type_union_free(
+ &(simple_type_union_impl->simple_type_union), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ simple_type_union_impl->simple_type_union.ops->free =
+ axis2_xml_schema_simple_type_union_free;
+ simple_type_union_impl->simple_type_union.ops->get_base_impl =
+ axis2_xml_schema_simple_type_union_get_base_impl;
+ simple_type_union_impl->simple_type_union.ops->get_base_types =
+ axis2_xml_schema_simple_type_union_get_base_types;
+ simple_type_union_impl->simple_type_union.ops->set_member_types_source =
+ axis2_xml_schema_simple_type_union_set_member_types_source;
+ simple_type_union_impl->simple_type_union.ops->get_member_types_source =
+ axis2_xml_schema_simple_type_union_get_member_types_source;
+ simple_type_union_impl->simple_type_union.ops->get_member_types_qnames =
+ axis2_xml_schema_simple_type_union_get_member_types_qnames;
+
+ simple_type_union_impl->methods = axis2_hash_make(env);
+ if(!simple_type_union_impl->methods)
+ {
+ axis2_xml_schema_simple_type_union_free(&(simple_type_union_impl->simple_type_union), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(simple_type_union_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_simple_type_union_free);
+ axis2_hash_set(simple_type_union_impl->methods, "get_base_types",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_union_get_base_types);
+ axis2_hash_set(simple_type_union_impl->methods, "set_member_types_source",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_union_set_member_types_source);
+ axis2_hash_set(simple_type_union_impl->methods, "get_member_types_source",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_union_get_member_types_source);
+ axis2_hash_set(simple_type_union_impl->methods, "get_member_types_qnames",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_union_get_member_types_qnames);
+
+ simple_type_union_impl->sim_type_content =
+ axis2_xml_schema_simple_type_content_create(env);
+
+ if(!simple_type_union_impl->sim_type_content)
+ {
+ axis2_xml_schema_simple_type_union_free(
+ &(simple_type_union_impl->simple_type_union), env);
+ return NULL;
+ }
+
+ simple_type_union_impl->base_types =
+ axis2_xml_schema_obj_collection_create(env);
+
+ if(!simple_type_union_impl->base_types)
+ {
+ axis2_xml_schema_simple_type_union_free(
+ &(simple_type_union_impl->simple_type_union), env);
+ return NULL;
+ }
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_SET_TYPE(
+ simple_type_union_impl->sim_type_content, env,
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_UNION);
+
+ status = axis2_xml_schema_simple_type_content_resolve_methods(
+ &(simple_type_union_impl->simple_type_union.base), env, simple_type_union_impl->sim_type_content,
+ simple_type_union_impl->methods);
+
+ return &(simple_type_union_impl->simple_type_union);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_union_free(void *simple_type_union,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_union_impl_t *simple_type_union_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ simple_type_union_impl = AXIS2_INTF_TO_IMPL(simple_type_union);
+
+ if(NULL != simple_type_union_impl->methods)
+ {
+ axis2_hash_free(simple_type_union_impl->methods, env);
+ simple_type_union_impl->methods = NULL;
+ }
+
+ if(NULL != simple_type_union_impl->sim_type_content)
+ {
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_FREE(
+ simple_type_union_impl->sim_type_content , env);
+ simple_type_union_impl->sim_type_content = NULL;
+ }
+
+ if(NULL != simple_type_union_impl->simple_type_union.ops)
+ {
+ AXIS2_FREE((*env)->allocator,
+ simple_type_union_impl->simple_type_union.ops);
+ simple_type_union_impl->simple_type_union.ops = NULL;
+ }
+ if(NULL != simple_type_union_impl->simple_type_union.base.ops)
+ {
+ AXIS2_FREE((*env)->allocator,
+ simple_type_union_impl->simple_type_union.base.ops);
+ simple_type_union_impl->simple_type_union.base.ops = NULL;
+ }
+
+ if(NULL != simple_type_union_impl)
+ {
+ AXIS2_FREE((*env)->allocator, simple_type_union_impl);
+ simple_type_union_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_simple_type_content_t *AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_base_impl(void *simple_type_union,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_union_impl_t *simple_type_union_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ simple_type_union_impl = AXIS2_INTF_TO_IMPL(simple_type_union);
+
+ return simple_type_union_impl->sim_type_content;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_simple_type_union_resolve_methods(
+ axis2_xml_schema_simple_type_union_t *simple_type_union,
+ axis2_env_t **env,
+ axis2_xml_schema_simple_type_union_t *simple_type_union_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_simple_type_union_impl_t *simple_type_union_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, simple_type_union_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ simple_type_union_impl_l =
+ (axis2_xml_schema_simple_type_union_impl_t *) simple_type_union_impl;
+
+ simple_type_union->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_simple_type_union_ops_t));
+ if(NULL != simple_type_union->ops)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+
+ simple_type_union->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ simple_type_union->ops->get_base_impl =
+ simple_type_union_impl_l->simple_type_union.ops->get_base_impl;
+
+ simple_type_union->ops->get_base_types =
+ simple_type_union_impl_l->simple_type_union.ops->get_base_types;
+
+ simple_type_union->ops->get_member_types_qnames =
+ simple_type_union_impl_l->simple_type_union.ops->get_member_types_qnames;
+
+ simple_type_union->ops->get_member_types_source =
+ simple_type_union_impl_l->simple_type_union.ops->get_member_types_source;
+ simple_type_union->ops->set_member_types_source =
+ simple_type_union_impl_l->simple_type_union.ops->set_member_types_source;
+
+ return axis2_xml_schema_simple_type_content_resolve_methods(
+ &(simple_type_union->base), env,
+ simple_type_union_impl_l->sim_type_content, methods);
+}
+
+axis2_xml_schema_obj_collection_t* AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_base_types(void *simple_type_union,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return
+ AXIS2_INTF_TO_IMPL(simple_type_union)->base_types;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_simple_type_union_set_member_types_source(void *simple_type_union,
+ axis2_env_t **env,
+ axis2_char_t *member_types_source)
+
+{
+ axis2_xml_schema_simple_type_union_impl_t *sim_type_res_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ sim_type_res_impl = AXIS2_INTF_TO_IMPL(simple_type_union);
+ if(NULL != sim_type_res_impl->member_types_source)
+ {
+ AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_FREE(sim_type_res_impl->member_types_source, env);
+ sim_type_res_impl->member_types_source = NULL;
+ }
+
+ sim_type_res_impl->member_types_source = AXIS2_STRDUP(member_types_source, env);
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t* AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_member_types_source
+ (void *simple_type_union,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return AXIS2_INTF_TO_IMPL(simple_type_union)->member_types_source;
+}
+
+
+axis2_array_list_t* AXIS2_CALL
+axis2_xml_schema_simple_type_union_get_member_types_qnames(void *simple_type_union,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_simple_type_union_impl_t *sim_type_res_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ return sim_type_res_impl->member_types_qnames;
+}
Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_type.c?rev=397881&r1=397880&r2=397881&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_type.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_type.c Fri Apr 28 05:28:53 2006
@@ -20,7 +20,7 @@
#include <axis2_xml_schema_data_type.h>
#include <axis2_xml_schema_derivation_method.h>
#include <axis2_xml_schema.h>
-
+#include <axis2_qname.h>
typedef struct axis2_xml_schema_type_impl
axis2_xml_schema_type_impl_t;
@@ -53,6 +53,8 @@
axis2_char_t *name;
axis2_xml_schema_t *schema;
+
+ axis2_qname_t *qname;
};
#define AXIS2_INTF_TO_IMPL(type) ((axis2_xml_schema_type_impl_t *) type)
@@ -141,7 +143,8 @@
type_impl->data_type = NULL;
type_impl->methods = NULL;
type_impl->annotated = NULL;
-
+ type_impl->base_schema_type = NULL;
+ type_impl->qname = NULL;
type_impl->schema = schema;
type_impl->type.ops = AXIS2_MALLOC((*env)->allocator,
@@ -350,10 +353,12 @@
axis2_xml_schema_data_type_t *AXIS2_CALL
axis2_xml_schema_type_get_data_type(void *type,
- axis2_env_t **env)
+ axis2_env_t **env)
{
+ axis2_xml_schema_type_impl_t *type_impl = NULL;
AXIS2_ENV_CHECK(env, NULL);
- return NULL;
+ type_impl = AXIS2_INTF_TO_IMPL(type);
+ return type_impl->data_type;
}
axis2_xml_schema_derivation_method_t *AXIS2_CALL
@@ -398,14 +403,21 @@
axis2_xml_schema_type_get_final_resolved(void *type,
axis2_env_t **env)
{
- return NULL;
+ axis2_xml_schema_type_impl_t *type_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ type_impl = AXIS2_INTF_TO_IMPL(type);
+ return type_impl->final_resolved;
+
}
axis2_bool_t AXIS2_CALL
axis2_xml_schema_type_is_mixed(void *type,
axis2_env_t **env)
{
- return AXIS2_TRUE;
+ axis2_xml_schema_type_impl_t *type_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ type_impl = AXIS2_INTF_TO_IMPL(type);
+ return type_impl->is_mixed;
}
axis2_status_t AXIS2_CALL
@@ -413,14 +425,20 @@
axis2_env_t **env,
axis2_bool_t is_mixed)
{
- return AXIS2_SUCCESS;
+ axis2_xml_schema_type_impl_t *type_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ type_impl = AXIS2_INTF_TO_IMPL(type);
+ return type_impl->is_mixed = is_mixed;
}
axis2_char_t *AXIS2_CALL
axis2_xml_schema_type_get_name(void *type,
axis2_env_t **env)
{
- return NULL;
+ axis2_xml_schema_type_impl_t *type_impl = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ type_impl = AXIS2_INTF_TO_IMPL(type);
+ return type_impl->name;
}
axis2_status_t AXIS2_CALL
@@ -428,6 +446,20 @@
axis2_env_t **env,
axis2_char_t *name)
{
+ axis2_xml_schema_type_impl_t *type_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, name, AXIS2_FAILURE);
+ type_impl = AXIS2_INTF_TO_IMPL(type);
+ if(NULL != type_impl->name)
+ {
+ AXIS2_FREE((*env)->allocator, type_impl->name);
+ type_impl->name = NULL;
+ }
+ type_impl->name = AXIS2_STRDUP(name, env);
+ if(!type_impl->name)
+ {
+ return AXIS2_FAILURE;
+ }
return AXIS2_SUCCESS;
}
@@ -435,6 +467,26 @@
axis2_xml_schema_type_get_qname(void *type,
axis2_env_t **env)
{
- return NULL;
+ axis2_xml_schema_type_impl_t *type_impl = NULL;
+ axis2_char_t *target_ns = NULL;
+ AXIS2_ENV_CHECK(env, NULL);
+ type_impl = AXIS2_INTF_TO_IMPL(type);
+ if(!(type_impl->name))
+ {
+ return NULL;
+ }
+ if(NULL != type_impl->qname)
+ {
+ AXIS2_QNAME_FREE(type_impl->qname, env);
+ type_impl->qname = NULL;
+ }
+ if(NULL != type_impl->schema)
+ {
+ target_ns =
+ AXIS2_XML_SCHEMA_GET_TARGET_NAMESPACE(type_impl->schema, env);
+ }
+
+ type_impl->qname = axis2_qname_create(env, type_impl->name, target_ns, NULL);
+ return type_impl->qname;
}