Package org.exolab.castor.xml.schema

Examples of org.exolab.castor.xml.schema.AttributeGroup


            String err = "When redefining an AttributeGroup, the group must have a name.\n";
            error(err);
          }
         
          //1-- the attributeGroup must exist in the imported schema
          AttributeGroup original = _importedSchema.getAttributeGroup(structureName);
          if (original == null) {
            String err = "When redefining an AttributeGroup, the AttributeGroup must be present in the imported XML schema.\n"
              +"AttributeGroup: "+structureName+" is not defined in XML Schema:" + _importedSchema.getSchemaLocation();
            error(err);
          }
View Full Code Here


       
        //-- process all top level attributeGroup declarations
        enumeration = schema.getAttributeGroups();
        while (enumeration.hasMoreElements()) {
          boolean found = false;
          AttributeGroup temp = (AttributeGroup) enumeration.nextElement();
          //-- check if this attributeGroup is not
            //-- part of a redefinition
           if (temp instanceof AttributeGroupDecl) {
            if (((AttributeGroupDecl)temp).isRedefined())
              found = true;
           }
           
           //--check if this attributeGroup is not
           //-- included
           Enumeration includedSchemas = schema.getCachedIncludedSchemas();
           while (includedSchemas.hasMoreElements()) {
               Schema tempSchema = (Schema)includedSchemas.nextElement();
               if (temp instanceof AttributeGroupDecl) {
                   String name = ((AttributeGroupDecl)temp).getName()
                   found = (tempSchema.getAttributeGroup(name)!= null);
               }
           }
          
           if (!found)
                processAttributeGroup(temp,schemaPrefix);
        }

        //-- process all top level attribute declarations
        enumeration = schema.getAttributes();
        while (enumeration.hasMoreElements()) {
          AttributeDecl temp = (AttributeDecl) enumeration.nextElement();
          boolean found = false;
          //--check if this attributeGroup is not
          //-- included
          Enumeration includedSchemas = schema.getCachedIncludedSchemas();
          while (includedSchemas.hasMoreElements()) {
            Schema tempSchema = (Schema)includedSchemas.nextElement();
            found = (tempSchema.getAttribute(temp.getName())!= null);
          }
         
          if (!found)
                processAttribute(temp,schemaPrefix);
        }

        //-- process all top level element declarations
        enumeration = schema.getElementDecls();
        while (enumeration.hasMoreElements()) {
          ElementDecl temp = (ElementDecl) enumeration.nextElement();
          boolean found = false;
          //--check if this attributeGroup is not
          //-- included
          Enumeration includedSchemas = schema.getCachedIncludedSchemas();
          while (includedSchemas.hasMoreElements()) {
            Schema tempSchema = (Schema)includedSchemas.nextElement();
            found = (tempSchema.getElementDecl(temp.getName())!= null);
          }
         
          if (!found)
              processElement(temp,schemaPrefix);
        }

        //-- process all top level complex types
        enumeration = schema.getComplexTypes();
        while (enumeration.hasMoreElements()) {
            ComplexType temp = (ComplexType) enumeration.nextElement();
            boolean found = false;
            //--check if this attributeGroup is not
            //-- included
            Enumeration includedSchemas = schema.getCachedIncludedSchemas();
            while (includedSchemas.hasMoreElements()) {
              Schema tempSchema = (Schema)includedSchemas.nextElement();
              found = (tempSchema.getComplexType(temp.getName())!= null);
            }
            if (!temp.isRedefined() && !found)
                processComplexType(temp, schemaPrefix);
        }

        //-- process all top level groups
        enumeration = schema.getModelGroups();
        while (enumeration.hasMoreElements()) {
          ModelGroup temp = (ModelGroup)enumeration.nextElement();
          boolean found = false;
          //--check if this Group is not
          //-- included
          Enumeration includedSchemas = schema.getCachedIncludedSchemas();
          while (includedSchemas.hasMoreElements()) {
            Schema tempSchema = (Schema)includedSchemas.nextElement();
            found = (tempSchema.getModelGroup(temp.getName())!= null);
          }
         
          if (!temp.isRedefined() && !found)
              processGroup(temp, schemaPrefix);
        }

        //-- process all top level simple types
        enumeration = schema.getSimpleTypes();
        while (enumeration.hasMoreElements()) {
            SimpleType temp = (SimpleType) enumeration.nextElement();
            boolean found = false;
            //--check if this attributeGroup is not
            //-- included
            Enumeration includedSchemas = schema.getCachedIncludedSchemas();
            while (includedSchemas.hasMoreElements()) {
              Schema tempSchema = (Schema)includedSchemas.nextElement();
              found = (tempSchema.getSimpleType(temp.getName())!= null);
            }
            if (!temp.isRedefined() && !found)
                processSimpleType(temp, schemaPrefix);
        }

        _handler.endElement(ELEM_SCHEMA);
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.schema.AttributeGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.