Examples of AttributeGroup


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

       
        //-- 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

Examples of org.geotools.xml.schema.AttributeGroup

                if (o instanceof AttributeHandler) {
                    h.add(((AttributeHandler) o).compress(parent));
                } else {
                    AttributeGroupHandler agh = (AttributeGroupHandler) o;
                    AttributeGroup ag = agh.compress(parent);

                    if ((ag != null) && (ag.getAttributes() != null)) {
                        Attribute[] aa = ag.getAttributes();

                        for (int j = 0; j < aa.length; j++)
                            h.add(aa[j]);
                    }
                }
            }

            attributes = (Attribute[]) h.toArray(new Attribute[h.size()]);
        }

        String name1 = this.name;

        if ((ref != null) && !"".equalsIgnoreCase(ref)) {
            AttributeGroup ag = parent.lookUpAttributeGroup(ref);

            if (ag == null) {
                throw new SAXException("AttributeGroup '" + ref
                    + "' was refered and not found");
            }

            name1 = ag.getName();

            if ((anyAttribute == null)
                    || "".equalsIgnoreCase(anyAttribute.getNamespace())) {
                anyAttributeNamespace = ag.getAnyAttributeNameSpace();
            }

            if (attributes != null) {
                throw new SAXException(
                    "Cannot have a ref and children for an AttributeGroup");
            }

            attributes = ag.getAttributes();
        }

        cache = new AttributeGroupGT(id, name1,
                parent.getTargetNamespace(), attributes, anyAttributeNamespace);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.