axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r406594 [8/8] - in /webservices/axis2/trunk/c/modules/xml/xml_schema: ./ include/xml_schema/
Date Mon, 15 May 2006 09:31:15 GMT
Modified: 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=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_union.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_simple_type_union.c Mon May 15 02:31:10 2006
@@ -31,6 +31,10 @@
     
     axis2_hash_t *methods;
     
+    axis2_hash_t *ht_super;
+    
+    axis2_xml_schema_types_t obj_type;
+    
     axis2_char_t *member_types_source;
     
     axis2_array_list_t *member_types_qnames;
@@ -47,9 +51,18 @@
 axis2_xml_schema_simple_type_union_free(void *simple_type_union,
                         axis2_env_t **env);
 
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_simple_type_union_type(void *simple_type_union,
+                                        axis2_env_t **env);
+
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_simple_type_union_super_objs(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_env_t **env);                                                                                
 
 axis2_xml_schema_obj_collection_t* AXIS2_CALL
 axis2_xml_schema_simple_type_union_get_base_types(void *simple_type_union,
@@ -75,6 +88,7 @@
 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_xml_schema_annotated_t *annotated = NULL;
     axis2_status_t status = AXIS2_FAILURE;
 
     simple_type_union_impl = AXIS2_MALLOC((*env)->allocator, 
@@ -92,6 +106,9 @@
     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->ht_super = NULL;
+    simple_type_union_impl->obj_type = AXIS2_XML_SCHEMA_SIMPLE_TYPE_UNION;
+    
     
     simple_type_union_impl->simple_type_union.ops = 
         AXIS2_MALLOC((*env)->allocator, 
@@ -109,6 +126,10 @@
             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->type =
+            axis2_xml_schema_simple_type_union_type;
+    simple_type_union_impl->simple_type_union.ops->super_objs =
+            axis2_xml_schema_simple_type_union_super_objs;
     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 = 
@@ -119,9 +140,12 @@
             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)
+    simple_type_union_impl->ht_super = axis2_hash_make(env);
+    
+    if(!simple_type_union_impl->methods || !simple_type_union_impl->ht_super)
     {
-        axis2_xml_schema_simple_type_union_free(&(simple_type_union_impl->simple_type_union), env);
+        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;
     }
@@ -129,7 +153,10 @@
             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_set(simple_type_union_impl->methods, "type", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_union_type);
+    axis2_hash_set(simple_type_union_impl->methods, "super_objs", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_simple_type_union_super_objs);                 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);
@@ -155,9 +182,26 @@
             &(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);
+
+    
+    axis2_hash_set(simple_type_union_impl->ht_super, "AXIS2_XML_SCHEMA_SIMPLE_TYPE_UNION", 
+            AXIS2_HASH_KEY_STRING, &(simple_type_union_impl->simple_type_union));
+
+    axis2_hash_set(simple_type_union_impl->ht_super, "AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT", 
+            AXIS2_HASH_KEY_STRING, simple_type_union_impl->sim_type_content);
+    
+    annotated = AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_GET_BASE_IMPL(
+        simple_type_union_impl->sim_type_content, env);
+
+    if(NULL != annotated)
+    {
+        axis2_hash_set(simple_type_union_impl->ht_super, "AXIS2_XML_SCHEMA_ANNOTATED", 
+            AXIS2_HASH_KEY_STRING, annotated);
+            
+        axis2_hash_set(simple_type_union_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ",
+            AXIS2_HASH_KEY_STRING, 
+            AXIS2_XML_SCHEMA_ANNOTATED_GET_BASE_IMPL(annotated, env));
+    }
             
     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, 
@@ -180,7 +224,11 @@
         axis2_hash_free(simple_type_union_impl->methods, env);
         simple_type_union_impl->methods = NULL;
     }
-
+    if(NULL != simple_type_union_impl->ht_super)
+    {
+        axis2_hash_free(simple_type_union_impl->ht_super, env);
+        simple_type_union_impl->ht_super = NULL;
+    }
     if(NULL != simple_type_union_impl->sim_type_content)
     {
         AXIS2_XML_SCHEMA_SIMPLE_TYPE_CONTENT_FREE(
@@ -221,6 +269,7 @@
     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,
@@ -265,6 +314,7 @@
                 &(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,
@@ -313,3 +363,17 @@
     AXIS2_ENV_CHECK(env, NULL);
     return sim_type_res_impl->member_types_qnames;
 }
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_simple_type_union_type(void *simple_type_union,
+                                        axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(simple_type_union)->obj_type;
+}                                        
+
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_simple_type_union_super_objs(void *simple_type_union,
+                                        axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(simple_type_union)->ht_super;
+}                                        

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=406594&r1=406593&r2=406594&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 Mon May 15 02:31:10 2006
@@ -55,9 +55,14 @@
     axis2_xml_schema_t *schema;
     
     axis2_qname_t *qname;
+    
+    axis2_hash_t *ht_super;
+    
+    axis2_xml_schema_types_t obj_type;
 };
 
-#define AXIS2_INTF_TO_IMPL(type) ((axis2_xml_schema_type_impl_t *) type)
+#define AXIS2_INTF_TO_IMPL(type) \
+        ((axis2_xml_schema_type_impl_t *) type)
 
 /************************** function prototypes ******************************/
 
@@ -68,6 +73,14 @@
 axis2_xml_schema_annotated_t *AXIS2_CALL
 axis2_xml_schema_type_get_base_impl(void *type,
                                         axis2_env_t **env);
+                                        
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_type_type(void *type,
+                           axis2_env_t **env); 
+                                        
+axis2_hash_t*  AXIS2_CALL
+axis2_xml_schema_type_super_objs(void *type,
+                                axis2_env_t **env);                                                                               
 
 void *AXIS2_CALL
 axis2_xml_schema_type_get_base_schema_type(void *type,
@@ -145,8 +158,10 @@
     type_impl->annotated = NULL;
     type_impl->base_schema_type = NULL;
     type_impl->qname = NULL;
-
+    type_impl->ht_super = NULL;
+    type_impl->obj_type = AXIS2_XML_SCHEMA_TYPE;
     type_impl->schema = schema;
+
     type_impl->type.ops = AXIS2_MALLOC((*env)->allocator, 
                     sizeof(axis2_xml_schema_type_ops_t));
 
@@ -159,9 +174,14 @@
         return NULL;
     }
 
-    type_impl->type.ops->free = axis2_xml_schema_type_free;
+    type_impl->type.ops->free = 
+            axis2_xml_schema_type_free;
     type_impl->type.ops->get_base_impl = 
             axis2_xml_schema_type_get_base_impl;
+    type_impl->type.ops->type =
+            axis2_xml_schema_type_type;
+    type_impl->type.ops->super_objs =
+            axis2_xml_schema_type_super_objs;
     type_impl->type.ops->get_base_schema_type = 
             axis2_xml_schema_type_get_base_schema_type;
     type_impl->type.ops->get_data_type = 
@@ -205,6 +225,10 @@
             axis2_xml_schema_type_free);
     axis2_hash_set(type_impl->methods, "get_base_schema_type", 
             AXIS2_HASH_KEY_STRING, axis2_xml_schema_type_get_base_schema_type);
+    axis2_hash_set(type_impl->methods, "type", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_type_type);
+    axis2_hash_set(type_impl->methods, "super_objs", 
+            AXIS2_HASH_KEY_STRING, axis2_xml_schema_type_super_objs);            
     axis2_hash_set(type_impl->methods, "get_data_type", 
             AXIS2_HASH_KEY_STRING, axis2_xml_schema_type_get_data_type);
     axis2_hash_set(type_impl->methods, "get_derive_by", 
@@ -232,6 +256,23 @@
         axis2_xml_schema_type_free(&(type_impl->annotated), env);
         return NULL;
     }
+    type_impl->ht_super = axis2_hash_make(env);
+    if(!type_impl->ht_super)
+    {
+        axis2_xml_schema_type_free(&(type_impl->annotated), env);
+        return NULL;
+    }
+    axis2_hash_set(type_impl->ht_super, "AXIS2_XML_SCHEMA_TYPE", 
+        AXIS2_HASH_KEY_STRING, &(type_impl->type));
+        
+    axis2_hash_set(type_impl->ht_super, "AXIS2_XML_SCHEMA_ANNOTATED", 
+        AXIS2_HASH_KEY_STRING, type_impl->annotated);
+            
+    axis2_hash_set(type_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ", 
+        AXIS2_HASH_KEY_STRING, 
+        AXIS2_XML_SCHEMA_ANNOTATED_GET_BASE_IMPL(type_impl->annotated, env));
+            
+    
     status = axis2_xml_schema_annotated_resolve_methods(
             &(type_impl->type.base), env, type_impl->annotated, 
             type_impl->methods);
@@ -280,10 +321,8 @@
                                 axis2_env_t **env)
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
     type_impl = AXIS2_INTF_TO_IMPL(type);
-
     return type_impl->annotated;
 }
 
@@ -294,13 +333,13 @@
                                 axis2_xml_schema_type_t *type_impl,
                                 axis2_hash_t *methods)
 {
-    axis2_xml_schema_type_impl_t *type_impl_l = NULL;
+    axis2_xml_schema_type_impl_t *sch_type_impl = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, type_impl, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
     
-    type_impl_l = (axis2_xml_schema_type_impl_t *) type_impl;
+    sch_type_impl = (axis2_xml_schema_type_impl_t *) type_impl;
     
     type->ops = AXIS2_MALLOC((*env)->allocator, 
             sizeof(axis2_xml_schema_type_ops_t));
@@ -312,33 +351,80 @@
             
     type->ops->free = axis2_hash_get(methods, "free", 
             AXIS2_HASH_KEY_STRING);
-    type->ops->get_base_impl = 
-            type_impl_l->type.ops->get_base_impl;
-    type->ops->get_base_schema_type = 
-            type_impl_l->type.ops->get_base_schema_type;
-    type->ops->get_data_type = 
-            type_impl_l->type.ops->get_data_type;
-    type->ops->get_derive_by = 
-            type_impl_l->type.ops->get_derive_by;
+    type->ops->type = axis2_hash_get(methods, "type",
+            AXIS2_HASH_KEY_STRING);
+    type->ops->type = axis2_hash_get(methods, "super_objs",
+            AXIS2_HASH_KEY_STRING);                        
+            
+
+    type->ops->get_base_schema_type = axis2_hash_get(methods, "get_base_schema_type",
+         AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->get_base_schema_type)           
+        type->ops->get_base_schema_type = 
+            sch_type_impl->type.ops->get_base_schema_type;
+
+    type->ops->get_data_type = axis2_hash_get(methods, "get_data_type",
+         AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->get_data_type)           
+        type->ops->get_data_type = 
+            sch_type_impl->type.ops->get_data_type;
+
+    type->ops->get_derive_by = axis2_hash_get(methods, "get_derive_by",
+         AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->get_derive_by)           
+        type->ops->get_derive_by = 
+            sch_type_impl->type.ops->get_derive_by;
+            
+    type->ops->get_final = axis2_hash_get(methods, "get_final",
+         AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->get_final)         
     type->ops->get_final = 
-            type_impl_l->type.ops->get_final;
-    type->ops->set_final = 
-            type_impl_l->type.ops->set_final;
+            sch_type_impl->type.ops->get_final;
+            
+    type->ops->set_final = axis2_hash_get(methods, "set_final",
+        AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->set_final)          
+        type->ops->set_final = 
+            sch_type_impl->type.ops->set_final;
+
+    type->ops->get_final_resolved = axis2_hash_get(methods, "get_final_resolved",
+        AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->get_final_resolved)            
     type->ops->get_final_resolved = 
-            type_impl_l->type.ops->get_final_resolved;
+            sch_type_impl->type.ops->get_final_resolved;
+            
+    type->ops->is_mixed = axis2_hash_get(methods, "is_mixed",
+        AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->is_mixed)  
     type->ops->is_mixed = 
-            type_impl_l->type.ops->is_mixed;
+            sch_type_impl->type.ops->is_mixed;
+     
+    type->ops->set_mixed = axis2_hash_get(methods, "set_mixed",
+        AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->set_mixed)              
     type->ops->set_mixed = 
-            type_impl_l->type.ops->set_mixed;
-    type->ops->get_name = 
-            type_impl_l->type.ops->get_name;
+            sch_type_impl->type.ops->set_mixed;
+            
+    type->ops->get_name = axis2_hash_get(methods, "get_name",
+        AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->get_name)             
+        type->ops->get_name = 
+            sch_type_impl->type.ops->get_name;
+            
+    type->ops->set_name = axis2_hash_get(methods, "set_name",
+        AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->set_name)             
     type->ops->set_name = 
-            type_impl_l->type.ops->set_name;
+            sch_type_impl->type.ops->set_name;
+            
+    type->ops->get_qname = axis2_hash_get(methods, "get_qname",
+        AXIS2_HASH_KEY_STRING);            
+    if(!type->ops->get_qname)            
     type->ops->get_qname = 
-            type_impl_l->type.ops->get_qname;
+            sch_type_impl->type.ops->get_qname;
     
     return axis2_xml_schema_annotated_resolve_methods(&(type->base), 
-            env, type_impl_l->annotated, methods);
+            env, sch_type_impl->annotated, methods);
 }
 
 void *AXIS2_CALL
@@ -346,8 +432,16 @@
                                             axis2_env_t **env)
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return NULL;
+    }
     return type_impl->base_schema_type;
 }
 
@@ -356,8 +450,16 @@
                                     axis2_env_t **env)
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return NULL;
+    }
     return type_impl->data_type;
 }
 
@@ -366,8 +468,16 @@
                                     axis2_env_t **env)
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return NULL;
+    }
     return type_impl->derive_by;
 }
 
@@ -376,8 +486,16 @@
                                 axis2_env_t **env)
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return NULL;
+    }
     return type_impl->final_derivation;
 }
 
@@ -387,9 +505,17 @@
                             axis2_xml_schema_derivation_method_t *final_derivation)
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, final_derivation, AXIS2_FAILURE);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return AXIS2_FAILURE;
+    }
     if(NULL != type_impl->final_derivation)
     {
         AXIS2_XML_SCHEMA_DERIVATION_METHOD_FREE(type_impl->final_derivation, env);
@@ -404,8 +530,16 @@
                                             axis2_env_t **env) 
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return NULL;
+    }
     return type_impl->final_resolved;
 
 }
@@ -415,8 +549,16 @@
                                 axis2_env_t **env) 
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return AXIS2_FAILURE;
+    }
     return type_impl->is_mixed;
 }
 
@@ -426,8 +568,16 @@
                                 axis2_bool_t is_mixed) 
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return AXIS2_FAILURE;
+    }
     return type_impl->is_mixed = is_mixed;
 }
 
@@ -436,8 +586,16 @@
                                 axis2_env_t **env) 
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return NULL;
+    }
     return type_impl->name;
 }
 
@@ -447,9 +605,17 @@
                                 axis2_char_t *name) 
 {
     axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, name, AXIS2_FAILURE);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return AXIS2_FAILURE;
+    }
     if(NULL != type_impl->name)
     {
         AXIS2_FREE((*env)->allocator, type_impl->name);
@@ -467,10 +633,19 @@
 axis2_xml_schema_type_get_qname(void *type,
                                 axis2_env_t **env) 
 {
-    axis2_xml_schema_type_impl_t *type_impl =  NULL;
+    axis2_xml_schema_type_impl_t *type_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
     axis2_char_t *target_ns = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    type_impl = AXIS2_INTF_TO_IMPL(type);
+    ht_super = AXIS2_XML_SCHEMA_TYPE_SUPER_OBJS(type, env);
+    if(NULL != ht_super)
+    {
+        type_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(ht_super, 
+                    "AXIS2_XML_SCHEMA_TYPE", AXIS2_HASH_KEY_STRING));
+        if(!type_impl)                
+            return NULL;
+    }
+
     if(!(type_impl->name))
     {
         return NULL;
@@ -490,3 +665,16 @@
     return type_impl->qname;
 }
 
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_type_type(void *type,
+                           axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(type)->obj_type;
+}                           
+                                        
+axis2_hash_t*  AXIS2_CALL
+axis2_xml_schema_type_super_objs(void *type,
+                                axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(type)->ht_super;
+}                                
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_use.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_use.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_use.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_use.c Mon May 15 02:31:10 2006
@@ -25,10 +25,15 @@
 struct axis2_xml_schema_use_impl
 {
     axis2_xml_schema_use_t use;
+    
     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;
 };
 
@@ -81,9 +86,10 @@
 
     use_impl->schema_enum = NULL;
     use_impl->obj_type = AXIS2_XML_SCHEMA_USE;
-    use_impl->super = NULL;
+    use_impl->ht_super = NULL;
     use_impl->methods = NULL;
     use_impl->members = NULL;
+    use_impl->use.base.ops = NULL;
     use_impl->use.ops = AXIS2_MALLOC((*env)->allocator, 
                     sizeof(axis2_xml_schema_use_ops_t));
     if(!use_impl->use.ops)
@@ -103,10 +109,14 @@
     use_impl->members = axis2_array_list_create(env, 0);
     if(!use_impl->members)
         return NULL;
-    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, "none");
-    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, "optional");
-    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, "prohibited");
-    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, "required");
+    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, 
+        AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_NONE, env));
+    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, 
+        AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_OPTIONAL, env));
+    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, 
+        AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_PROHIBITED, env));
+    AXIS2_ARRAY_LIST_ADD(use_impl->members, env, 
+        AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_REQUIRED, env));
 
     use_impl->methods = axis2_hash_make(env);
     if(!use_impl->methods)
@@ -128,18 +138,17 @@
 
     use_impl->schema_enum = axis2_xml_schema_enum_create(env, value);
 
-    use_impl->super = axis2_hash_make(env);
-    if(!use_impl->super)
+    use_impl->ht_super = axis2_hash_make(env);
+    if(!use_impl->ht_super)
     {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    axis2_hash_set(use_impl->super, "AXIS2_XML_SCHEMA_USE", AXIS2_HASH_KEY_STRING, 
+    axis2_hash_set(use_impl->ht_super, "AXIS2_XML_SCHEMA_USE", AXIS2_HASH_KEY_STRING, 
             &(use_impl->use));
-    axis2_hash_set(use_impl->super, "AXIS2_XML_SCHEMA_ENUM", AXIS2_HASH_KEY_STRING, 
+    axis2_hash_set(use_impl->ht_super, "AXIS2_XML_SCHEMA_ENUM", AXIS2_HASH_KEY_STRING, 
             use_impl->schema_enum);
 
-
     status = axis2_xml_schema_enum_resolve_methods(
             &(use_impl->use.base), env, use_impl->schema_enum, 
             use_impl->methods); 
@@ -181,10 +190,10 @@
         use_impl->schema_enum = NULL;
     }
     
-    if(NULL != use_impl->super)
+    if(NULL != use_impl->ht_super)
     {
-        axis2_hash_free(use_impl->super, env);
-        use_impl->super = NULL;
+        axis2_hash_free(use_impl->ht_super, env);
+        use_impl->ht_super = NULL;
     }
     
     if(NULL != use_impl->methods)
@@ -192,18 +201,20 @@
         axis2_hash_free(use_impl->methods, env);
         use_impl->methods = NULL;
     }
-
-    if((&(use_impl->use))->ops)
+    if(NULL != use_impl->use.base.ops)
     {
-        AXIS2_FREE((*env)->allocator, (&(use_impl->use))->ops);
-        (&(use_impl->use))->ops = NULL;
+        AXIS2_FREE((*env)->allocator, use_impl->use.base.ops);
+        use_impl->use.base.ops = NULL;
     }
 
-    if(use_impl)
+    if(NULL != use_impl->use.ops)
     {
-        AXIS2_FREE((*env)->allocator, use_impl);
-        use_impl = NULL;
+        AXIS2_FREE((*env)->allocator, use_impl->use.ops);
+        use_impl->use.ops = NULL;
     }
+
+    AXIS2_FREE((*env)->allocator, use_impl);
+    use_impl = NULL;
     return AXIS2_SUCCESS;
 }
 
@@ -213,11 +224,9 @@
         axis2_env_t **env)
 {
     axis2_xml_schema_use_impl_t *use_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
     use_impl = AXIS2_INTF_TO_IMPL(use);
-
-    return use_impl->super;
+    return use_impl->ht_super;
 }
 
 axis2_xml_schema_types_t AXIS2_CALL
@@ -226,10 +235,8 @@
         axis2_env_t **env)
 {
     axis2_xml_schema_use_impl_t *use_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     use_impl = AXIS2_INTF_TO_IMPL(use);
-
     return use_impl->obj_type;
 }
 
@@ -245,46 +252,6 @@
     return use_impl->schema_enum;
 }
 
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_schema_use_resolve_methods(
-       axis2_xml_schema_use_t *use,
-       axis2_env_t **env,
-       axis2_xml_schema_use_t *use_impl,
-       axis2_hash_t *methods)
-{
-    axis2_xml_schema_use_impl_t *use_impl_l = NULL;
-
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, use_impl, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-    
-    use_impl_l = (axis2_xml_schema_use_impl_t *) use_impl;
-    
-    use->ops = AXIS2_MALLOC((*env)->allocator, 
-            sizeof(axis2_xml_schema_use_ops_t));
-    if(!use->ops)
-    {
-        AXIS2_ERROR_SET((*env)->error, 
-            AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return AXIS2_FAILURE;
-    }
-    use->ops->free = axis2_hash_get(methods, "free", 
-            AXIS2_HASH_KEY_STRING);
-    use->ops->super_objs = axis2_hash_get(methods, "super_objs", 
-            AXIS2_HASH_KEY_STRING);
-    use->ops->type = axis2_hash_get(methods, "type", 
-            AXIS2_HASH_KEY_STRING);
-    
-    use->ops->get_values = axis2_hash_get(methods, "get_values", 
-            AXIS2_HASH_KEY_STRING);
-    if(!use->ops->get_values)
-            use->ops->get_values = 
-            use_impl_l->use.ops->get_values;
-    
-    return axis2_xml_schema_enum_resolve_methods(&(use->base), 
-            env, use_impl_l->schema_enum, methods);
-}
-
 axis2_array_list_t *AXIS2_CALL
 axis2_xml_schema_use_get_values(void *use,
                                         axis2_env_t **env)
@@ -295,6 +262,8 @@
     super = AXIS2_XML_SCHEMA_USE_SUPER_OBJS(use, env);
     use_impl = AXIS2_INTF_TO_IMPL(axis2_hash_get(super, "AXIS2_XML_SCHEMA_USE",
                 AXIS2_HASH_KEY_STRING));
-    return use_impl->members;
+    if(NULL != use_impl)                
+        return use_impl->members;
+    return NULL;        
 }
 

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_xpath.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_xpath.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_xpath.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_xpath.c Mon May 15 02:31:10 2006
@@ -28,6 +28,10 @@
     axis2_xml_schema_annotated_t *annotated;
     axis2_hash_t *methods;
     axis2_char_t *x_path;
+    
+    axis2_hash_t *ht_super;
+    
+    axis2_xml_schema_types_t obj_type;
 };
 
 #define AXIS2_INTF_TO_IMPL(xpath) ((axis2_xml_schema_xpath_impl_t *) xpath)
@@ -40,6 +44,14 @@
 axis2_xml_schema_xpath_get_base_impl(void *xpath,
                                         axis2_env_t **env);
 
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_xpath_type(void *xpath,
+                            axis2_env_t **env);
+                                        
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_xpath_super_objs(void *xpath,
+                                  axis2_env_t **env);
+                                                                                
 axis2_char_t *AXIS2_CALL
 axis2_xml_schema_xpath_get_xpath(void *xpath,
                                  axis2_env_t **env);
@@ -63,6 +75,8 @@
     xpath_impl->annotated = NULL;
     xpath_impl->methods = NULL;
     xpath_impl->x_path = NULL;
+    xpath_impl->ht_super = NULL;
+    xpath_impl->obj_type = AXIS2_XML_SCHEMA_XPATH;
     xpath_impl->xpath.ops = AXIS2_MALLOC((*env)->allocator, 
                     sizeof(axis2_xml_schema_xpath_ops_t));
 
@@ -73,6 +87,10 @@
             axis2_xml_schema_xpath_get_xpath;
     xpath_impl->xpath.ops->set_xpath = 
             axis2_xml_schema_xpath_set_xpath;
+    xpath_impl->xpath.ops->type =
+            axis2_xml_schema_xpath_type; 
+    xpath_impl->xpath.ops->super_objs =
+            axis2_xml_schema_xpath_super_objs;                       
    
     xpath_impl->methods = axis2_hash_make(env);
     if(!xpath_impl->methods)
@@ -88,6 +106,21 @@
             AXIS2_HASH_KEY_STRING, axis2_xml_schema_xpath_set_xpath);
     
     xpath_impl->annotated = axis2_xml_schema_annotated_create(env);
+    
+    xpath_impl->ht_super = axis2_hash_make(env);
+    if(!xpath_impl->ht_super)
+    {
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+    axis2_hash_set(xpath_impl->ht_super, "AXIS2_XML_SCHEMA_XPATH", AXIS2_HASH_KEY_STRING,
+        &(xpath_impl->xpath));
+    axis2_hash_set(xpath_impl->ht_super, "AXIS2_XML_SCHEMA_ANNOTATED", AXIS2_HASH_KEY_STRING,
+        xpath_impl->annotated);        
+    axis2_hash_set(xpath_impl->ht_super, "AXIS2_XML_SCHEMA_OBJ", AXIS2_HASH_KEY_STRING,
+        AXIS2_XML_SCHEMA_ANNOTATED_GET_BASE_IMPL(xpath_impl->annotated, env));
+
     status = axis2_xml_schema_annotated_resolve_methods(
             &(xpath_impl->xpath.base), env, xpath_impl->annotated, 
             xpath_impl->methods);
@@ -109,6 +142,11 @@
         AXIS2_FREE((*env)->allocator, xpath_impl->x_path);
         xpath_impl->x_path = NULL;
     }
+    if(xpath_impl->ht_super)
+    {
+        axis2_hash_free(xpath_impl->ht_super, env);
+        xpath_impl->ht_super = NULL;
+    }
 
     if(xpath_impl->methods)
     {
@@ -148,6 +186,7 @@
     return xpath_impl->annotated;
 }
 
+/*
 AXIS2_DECLARE(axis2_status_t)
 axis2_xml_schema_xpath_resolve_methods(
                                 axis2_xml_schema_xpath_t *xpath,
@@ -177,6 +216,7 @@
     return axis2_xml_schema_annotated_resolve_methods(&(xpath->base), 
             env, xpath_impl_l->annotated, methods);
 }
+*/
 
 axis2_char_t *AXIS2_CALL
 axis2_xml_schema_xpath_get_xpath(void *xpath,
@@ -211,4 +251,16 @@
 
     return AXIS2_SUCCESS;
 }
-
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_schema_xpath_type(void *xpath,
+                            axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(xpath)->obj_type;
+}
+                                        
+axis2_hash_t *AXIS2_CALL
+axis2_xml_schema_xpath_super_objs(void *xpath,
+                                  axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(xpath)->ht_super;
+}

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_severity_type.c Mon May 15 02:31:10 2006
@@ -26,9 +26,16 @@
 struct axis2_xml_severity_type_impl
 {
     axis2_xml_severity_type_t severity_type;
+    
     axis2_xml_schema_enum_t *schema_enum;
+    
     axis2_hash_t *methods;
+    
     axis2_array_list_t *members;
+    
+    axis2_hash_t *ht_super;
+    
+    axis2_xml_schema_types_t type;
 };
 
 #define AXIS2_INTF_TO_IMPL(severity_type) \
@@ -42,17 +49,17 @@
 axis2_xml_severity_type_get_base_impl(void *severity_type,
                                 axis2_env_t **env);
 
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_severity_type_resolve_methods(
-                                axis2_xml_severity_type_t *severity_type,
-                                axis2_env_t **env,
-                                axis2_xml_severity_type_t *severity_type_impl,
-                                axis2_hash_t *methods);
-
 axis2_array_list_t *AXIS2_CALL
 axis2_xml_severity_type_get_values(void *severity_type,
                         axis2_env_t **env);
 
+axis2_hash_t *AXIS2_CALL
+axis2_xml_severity_type_super_objs(void *severity_type,
+                                   axis2_env_t **env);
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_severity_type_type(void *severity_type,
+                            axis2_env_t **env);
 
 AXIS2_DECLARE(axis2_xml_severity_type_t *)
 axis2_xml_severity_type_create(axis2_env_t **env,
@@ -72,6 +79,9 @@
     severity_type_impl->schema_enum = NULL;
     severity_type_impl->methods = NULL;
     severity_type_impl->members = NULL;
+    severity_type_impl->ht_super = NULL;
+    severity_type_impl->type = AXIS2_XML_SEVERITY_TYPE;
+    
     severity_type_impl->severity_type.ops = AXIS2_MALLOC((*env)->allocator, 
                     sizeof(axis2_xml_severity_type_ops_t));
     if(!severity_type_impl->severity_type.ops)
@@ -88,16 +98,21 @@
             axis2_xml_severity_type_get_base_impl;
     severity_type_impl->severity_type.ops->get_values = 
             axis2_xml_severity_type_get_values;
-
+    severity_type_impl->severity_type.ops->type =
+            axis2_xml_severity_type_type;
+    severity_type_impl->severity_type.ops->super_objs =
+            axis2_xml_severity_type_super_objs;
+                           
     severity_type_impl->members = axis2_array_list_create(env, 0);
     if(!severity_type_impl->members)
     {    
         axis2_xml_severity_type_free(&(severity_type_impl->severity_type), env);
         return NULL;
     }       
-    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, "qualified");
-    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, "unqualified");
-    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, "none");
+    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, 
+        AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_ERROR, env));
+    AXIS2_ARRAY_LIST_ADD(severity_type_impl->members, env, 
+        AXIS2_STRDUP(AXIS2_XML_SCHEMA_CONST_WARNING, env));
 
     severity_type_impl->methods = axis2_hash_make(env);
     if(!severity_type_impl->methods)
@@ -111,7 +126,11 @@
             axis2_xml_severity_type_free);
     axis2_hash_set(severity_type_impl->methods, "get_values", AXIS2_HASH_KEY_STRING, 
             axis2_xml_severity_type_get_values);
-
+    axis2_hash_set(severity_type_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING,
+            axis2_xml_severity_type_super_objs);
+    axis2_hash_set(severity_type_impl->methods, "type", AXIS2_HASH_KEY_STRING,
+            axis2_xml_severity_type_type);
+            
     severity_type_impl->schema_enum = axis2_xml_schema_enum_create(env, value);
     if(!severity_type_impl->schema_enum)
     {
@@ -120,6 +139,20 @@
         return NULL;
     }
     
+    severity_type_impl->ht_super = axis2_hash_make(env);
+    if(!severity_type_impl->ht_super)
+    {
+        axis2_xml_severity_type_free(&(severity_type_impl->severity_type), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    axis2_hash_set(severity_type_impl->ht_super, "AXIS2_XML_SEVERITY_TYPE",
+       AXIS2_HASH_KEY_STRING,  &(severity_type_impl->severity_type));
+    
+    axis2_hash_set(severity_type_impl->ht_super, "AXIS2_XML_SCHEMA_ENUM",
+        AXIS2_HASH_KEY_STRING, severity_type_impl->schema_enum);        
+
     status = axis2_xml_schema_enum_resolve_methods(
             &(severity_type_impl->severity_type.base), env, severity_type_impl->schema_enum, 
             severity_type_impl->methods); 
@@ -161,12 +194,16 @@
         severity_type_impl->schema_enum = NULL;
     }
     
-    if((&(severity_type_impl->severity_type))->ops)
+    if(severity_type_impl->severity_type.ops)
     {
-        AXIS2_FREE((*env)->allocator, (&(severity_type_impl->severity_type))->ops);
-        (&(severity_type_impl->severity_type))->ops = NULL;
+        AXIS2_FREE((*env)->allocator, severity_type_impl->severity_type.ops);
+        severity_type_impl->severity_type.ops = NULL;
+    }
+    if(severity_type_impl->severity_type.base.ops)
+    {
+        AXIS2_FREE((*env)->allocator, severity_type_impl->severity_type.base.ops);
+        severity_type_impl->severity_type.base.ops = NULL;
     }
-
     if(severity_type_impl)
     {
         AXIS2_FREE((*env)->allocator, severity_type_impl);
@@ -186,38 +223,35 @@
     return severity_type_impl->schema_enum;
 }
 
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_severity_type_resolve_methods(
-                                axis2_xml_severity_type_t *severity_type,
-                                axis2_env_t **env,
-                                axis2_xml_severity_type_t *severity_type_impl,
-                                axis2_hash_t *methods)
-{
-    axis2_xml_severity_type_impl_t *severity_type_impl_l = NULL;
-
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, severity_type_impl, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-    
-    severity_type_impl_l = (axis2_xml_severity_type_impl_t *) severity_type_impl;
-    
-    severity_type->ops = AXIS2_MALLOC((*env)->allocator, 
-            sizeof(axis2_xml_severity_type_ops_t));
-    severity_type->ops->free = axis2_hash_get(methods, "free", 
-            AXIS2_HASH_KEY_STRING);
-    severity_type->ops->get_base_impl = 
-            severity_type_impl_l->severity_type.ops->get_base_impl;
-    severity_type->ops->get_values = 
-            severity_type_impl_l->severity_type.ops->get_values;
-    
-    return axis2_xml_schema_enum_resolve_methods(&(severity_type->base), 
-            env, severity_type_impl_l->schema_enum, methods);
-}
-
 axis2_array_list_t* AXIS2_CALL
 axis2_xml_severity_type_get_values(void *severity_type,
                                 axis2_env_t **env)
 {
+    /*
+    axis2_xml_severity_type_impl_t *severity_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
+    ht_super = AXIS2_XML_SEREVITY_TYPE_SUPER_OBJS(severity_type, env);
+    if(NULL != ht_super)
+    {
+        severity_impl = (axis2_xml_severity_type_impl_t*)
+            axis2_hash_get(ht_super, "AXIS2_XML_SEVERITY_TYPE", AXIS2_HASH_KEY_STRING);
+        return severity_impl->members;    
+    }
+    */
     return AXIS2_INTF_TO_IMPL(severity_type)->members;
 }
 
+
+axis2_hash_t *AXIS2_CALL
+axis2_xml_severity_type_super_objs(void *severity_type,
+                                   axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(severity_type)->ht_super;    
+}                                   
+
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_severity_type_type(void *severity_type,
+                            axis2_env_t **env)
+{                            
+    return AXIS2_INTF_TO_IMPL(severity_type)->type;
+}
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_tokenized_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_tokenized_type.c?rev=406594&r1=406593&r2=406594&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_tokenized_type.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_tokenized_type.c Mon May 15 02:31:10 2006
@@ -25,12 +25,22 @@
 struct axis2_xml_tokenized_type_impl
 {
     axis2_xml_tokenized_type_t tokenized_type;
+    
     axis2_xml_schema_enum_t *schema_enum;
+    
     axis2_hash_t *methods;
+    
     axis2_array_list_t *members;
+    
+    axis2_hash_t *ht_super;
+    
+    axis2_xml_schema_types_t obj_type;
 };
 
-#define AXIS2_INTF_TO_IMPL(tokenized_type) ((axis2_xml_tokenized_type_impl_t *) tokenized_type)
+#define AXIS2_INTF_TO_IMPL(tokenized_type) \
+        ((axis2_xml_tokenized_type_impl_t *) tokenized_type)
+
+/********************* function prototypes ***********************************/
 
 axis2_status_t AXIS2_CALL 
 axis2_xml_tokenized_type_free(void *tokenized_type,
@@ -40,17 +50,19 @@
 axis2_xml_tokenized_type_get_base_impl(void *tokenized_type,
                                 axis2_env_t **env);
 
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_tokenized_type_resolve_methods(
-                                axis2_xml_tokenized_type_t *tokenized_type,
-                                axis2_env_t **env,
-                                axis2_xml_tokenized_type_t *tokenized_type_impl,
-                                axis2_hash_t *methods);
-
 axis2_array_list_t * AXIS2_CALL
 axis2_xml_tokenized_type_get_values(void *tokenized_type,
                         axis2_env_t **env);
 
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_tokenized_type_type(void *tokenized_type,
+                        axis2_env_t **env);
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_tokenized_type_super_objs(void *tokenized_type,
+                                    axis2_env_t **env);
+
+/***************************** end macros **************************************/
 
 AXIS2_DECLARE(axis2_xml_tokenized_type_t *)
 axis2_xml_tokenized_type_create(axis2_env_t **env,
@@ -70,7 +82,9 @@
     tokenized_type_impl->schema_enum = NULL;
     tokenized_type_impl->methods = NULL;
     tokenized_type_impl->members = NULL;
+    tokenized_type_impl->obj_type = AXIS2_XML_TOKENIZED_TYPE;
     tokenized_type_impl->tokenized_type.ops = NULL;
+    tokenized_type_impl->ht_super = NULL;
     
     tokenized_type_impl->tokenized_type.ops = AXIS2_MALLOC((*env)->allocator, 
                     sizeof(axis2_xml_tokenized_type_ops_t));
@@ -90,28 +104,47 @@
     tokenized_type_impl->tokenized_type.ops->get_values = 
             axis2_xml_tokenized_type_get_values;
    
+    tokenized_type_impl->tokenized_type.ops->type = 
+            axis2_xml_tokenized_type_type;
+            
+    tokenized_type_impl->tokenized_type.ops->super_objs = 
+            axis2_xml_tokenized_type_super_objs; 
+                       
 
     tokenized_type_impl->members = axis2_array_list_create(env, 0);
     if(!tokenized_type_impl->members)
         return NULL;
         
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "CDATA");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "IDREF");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "IDREFS");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "ENTITY");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "ENTITIES");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "NMTOKEN");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "NMTOKENS");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "NOTATION");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "ENUMERATION");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "QName");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "NCName");
-    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, "None");
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("CDATA", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("IDREF", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env,
+        AXIS2_STRDUP("IDREFS", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env,
+        AXIS2_STRDUP("ENTITY", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env,
+        AXIS2_STRDUP("ENTITIES", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("NMTOKEN", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env,
+        AXIS2_STRDUP("NMTOKENS", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("NOTATION", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("ENUMERATION", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("QName", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("NCName", env));
+    AXIS2_ARRAY_LIST_ADD(tokenized_type_impl->members, env, 
+        AXIS2_STRDUP("None", env));
 
     tokenized_type_impl->methods = axis2_hash_make(env);
     
     if(!tokenized_type_impl->methods)
     {
+        axis2_xml_tokenized_type_free(&(tokenized_type_impl->tokenized_type), env);
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
@@ -121,7 +154,27 @@
     axis2_hash_set(tokenized_type_impl->methods, "get_values", AXIS2_HASH_KEY_STRING, 
             axis2_xml_tokenized_type_get_values);
 
+    axis2_hash_set(tokenized_type_impl->methods, "super_objs", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_tokenized_type_super_objs);
+
+    axis2_hash_set(tokenized_type_impl->methods, "type", AXIS2_HASH_KEY_STRING, 
+            axis2_xml_tokenized_type_type);
+
     tokenized_type_impl->schema_enum = axis2_xml_schema_enum_create(env, value);
+
+    tokenized_type_impl->ht_super = axis2_hash_make(env);
+    if(!tokenized_type_impl->ht_super)
+    {
+        axis2_xml_tokenized_type_free(&(tokenized_type_impl->tokenized_type), env);
+        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    
+    axis2_hash_set(tokenized_type_impl->ht_super , "AXIS2_XML_TOKENIZED_TYPE",
+        AXIS2_HASH_KEY_STRING, &(tokenized_type_impl->tokenized_type));
+    
+    axis2_hash_set(tokenized_type_impl->ht_super, "AXIS2_XML_SCHEMA_ENUM",
+        AXIS2_HASH_KEY_STRING, tokenized_type_impl->schema_enum);
     
     status = axis2_xml_schema_enum_resolve_methods(
             &(tokenized_type_impl->tokenized_type.base), env, tokenized_type_impl->schema_enum, 
@@ -164,10 +217,10 @@
         tokenized_type_impl->schema_enum = NULL;
     }
     
-    if(NULL != (&(tokenized_type_impl->tokenized_type))->ops)
+    if(NULL != tokenized_type_impl->tokenized_type.ops)
     {
-        AXIS2_FREE((*env)->allocator, (&(tokenized_type_impl->tokenized_type))->ops);
-        (&(tokenized_type_impl->tokenized_type))->ops = NULL;
+        AXIS2_FREE((*env)->allocator, tokenized_type_impl->tokenized_type.ops);
+        tokenized_type_impl->tokenized_type.ops = NULL;
     }
 
     if(NULL != tokenized_type_impl)
@@ -182,54 +235,41 @@
 axis2_xml_tokenized_type_get_base_impl(void *tokenized_type,
                                 axis2_env_t **env)
 {
-    axis2_xml_tokenized_type_impl_t *tokenized_type_impl = NULL;
-
-    AXIS2_ENV_CHECK(env, NULL);
-    tokenized_type_impl = AXIS2_INTF_TO_IMPL(tokenized_type);
-
-    return tokenized_type_impl->schema_enum;
-}
-
-AXIS2_DECLARE(axis2_status_t)
-axis2_xml_tokenized_type_resolve_methods(
-                        axis2_xml_tokenized_type_t *tokenized_type,
-                        axis2_env_t **env,
-                        axis2_xml_tokenized_type_t *tokenized_type_impl,
-                        axis2_hash_t *methods)
-{
-    axis2_xml_tokenized_type_impl_t *tokenized_type_impl_l = NULL;
-
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    
-    AXIS2_PARAM_CHECK((*env)->error, tokenized_type_impl, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
-    
-    tokenized_type_impl_l = (axis2_xml_tokenized_type_impl_t *) 
-        tokenized_type_impl;
-    
-    tokenized_type->ops = AXIS2_MALLOC((*env)->allocator, 
-            sizeof(axis2_xml_tokenized_type_ops_t));
-    if(!tokenized_type->ops)
-    {
-        AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return AXIS2_FAILURE;
-    }
-    
-    tokenized_type->ops->free = axis2_hash_get(methods, "free", AXIS2_HASH_KEY_STRING);
-    
-    tokenized_type->ops->get_base_impl = 
-            tokenized_type_impl_l->tokenized_type.ops->get_base_impl;
-    tokenized_type->ops->get_values = 
-            tokenized_type_impl_l->tokenized_type.ops->get_values;
-    
-    return axis2_xml_schema_enum_resolve_methods(&(tokenized_type->base), 
-            env, tokenized_type_impl_l->schema_enum, methods);
+    return AXIS2_INTF_TO_IMPL(tokenized_type)->schema_enum;
 }
 
 axis2_array_list_t *AXIS2_CALL
 axis2_xml_tokenized_type_get_values(void *tokenized_type,
                                         axis2_env_t **env)
 {
+    /*
+    axis2_xml_tokenized_type_impl_t *tokenized_impl = NULL;
+    axis2_hash_t *ht_super = NULL;
+    ht_super = AXIS2_XML_TOKENIZED_TYPE_SUPER_OBJS(tokenized_type, env);
+    if(NULL != ht_super)
+    {
+        tokenized_impl = (axis2_xml_tokenized_type_impl_t*)
+            axis2_hash_get(tokenized_impl->ht_super, "AXIS2_XML_TOKENIZED_TYPE",
+                AXIS2_HASH_KEY_STRING);
+        if(NULL != tokenized_impl)
+        {
+            return tokenized_impl->members;
+        }                
+    }
+    */
     return AXIS2_INTF_TO_IMPL(tokenized_type)->members;
 }
 
+axis2_xml_schema_types_t AXIS2_CALL
+axis2_xml_tokenized_type_type(void *tokenized_type,
+                        axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(tokenized_type)->obj_type;
+}                        
+
+axis2_hash_t* AXIS2_CALL
+axis2_xml_tokenized_type_super_objs(void *tokenized_type,
+                                    axis2_env_t **env)
+{
+    return AXIS2_INTF_TO_IMPL(tokenized_type)->ht_super;
+}                                    



Mime
View raw message