Examples of ModelGroup


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

                (AttributeGroupReference) unmarshaller.getObject();
            _complexType.addAttributeGroupReference(attrGroupRef);
        }
        //--group
        else if (name.equals(SchemaNames.GROUP)) {
            ModelGroup group = ((ModelGroupUnmarshaller)unmarshaller).getGroup();
            _complexType.addGroup(group);
        }

        //-- group declarations (all, choice, sequence)
        else if ( (SchemaNames.isGroupName(name)) && (name != SchemaNames.GROUP) )
View Full Code Here

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

        else if (SchemaNames.ELEMENT.equals(name)) {
            ElementDecl element = (ElementDecl) unmarshaller.getObject();
            _group.addElementDecl(element);
        }
        else if (name.equals(SchemaNames.GROUP)) {
            ModelGroup group = (ModelGroup) unmarshaller.getObject();
            _group.addGroup(group);
        }
        else if ( (SchemaNames.isGroupName(name)) && (name != SchemaNames.GROUP) )
        {
            Group group = ((GroupUnmarshaller)unmarshaller).getGroup();
View Full Code Here

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

//                location.append("anonymous");
//            }
            break;

        case Structure.MODELGROUP:
            ModelGroup group = (ModelGroup) structure;
            parent = group.getParent();
            if (parent.getStructureType() != Structure.SCHEMA) {
                getSchemaLocation(parent, location, dealWithAnonTypes);
            }
            if (group.getName() != null) {
                location.append(ExtendedBinding.PATH_SEPARATOR);
                location.append(ExtendedBinding.GROUP_ID);
                location.append(group.getName());
            }
            break;

        case Structure.ATTRIBUTE:
            parent = ((AttributeDecl) structure).getParent();
View Full Code Here

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

            final AttributeSet atts) {
        super(schemaContext);

        this._schema = schema;

        _group = new ModelGroup(_schema);

        //-- handle attributes
        String attValue = null;

View Full Code Here

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

        if (_redefineSchema.getSchemaLocation() == "") {
          String err = "In a <redefine>, only annotations can be defined when no -schemaLocation- is specified.";
          error(err);
        }
       
        ModelGroup group = null;
        group = (((ModelGroupUnmarshaller)_unmarshaller).getGroup());
       
        String structureName = group.getName();
        if (structureName == null) {
          String err = "When redefining a group, the group must have a name.\n";
          error(err);
        }
       
        //1-- the group must exist in the imported schema
        Group original = _importedSchema.getModelGroup(structureName);
        if (original == null) {
          String err = "When redefining a group, the group must be present in the imported XML schema.\n"
            +"Group: "+structureName+" is not defined in XML Schema:" + _importedSchema.getSchemaLocation();
          error(err);
        }
       
        //-- code needs to be added to check the Particle Valid (Restriction) constraint
        //--TBD
       
        group.setRedefined();
        _redefineSchema.addGroup(group);
      } else {
        String err = "In a <redefine>, only complexTypes|simpleTypes|groups or attributeGroups can be redefined.";
      error(err)
      }
View Full Code Here

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

                ((ElementUnmarshaller)unmarshaller).getElement();
            _complexType.addElementDecl(element);
        }
        //--group
        else if (name.equals(SchemaNames.GROUP)) {
            ModelGroup group = ((ModelGroupUnmarshaller)unmarshaller).getGroup();
            _complexType.addGroup(group);
        }

        //-- group declarations (all, choice, sequence)
        else if ( (SchemaNames.isGroupName(name)) && (name != SchemaNames.GROUP) )
View Full Code Here

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

        //-- ModelGroup
        String reference = null;
        if (group instanceof ModelGroup) {
            ELEMENT_NAME += GROUP;
            ModelGroup mGroup = (ModelGroup)group;
            if (mGroup.hasReference()) {
                ModelGroup refGroup = mGroup.getReference();
                if (refGroup != null) {
                    reference = refGroup.getName();
                    //-- prefix
                    String namespace = refGroup.getSchema().getTargetNamespace();
                    if (namespace == null) namespace = "";
                    String prefix = getNSPrefix(mGroup.getSchema(), namespace);
                    if ((prefix != null) && (prefix.length() > 0))
                        reference = prefix + ':' + reference;
                   
View Full Code Here

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

        }

        //-- 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.exolab.castor.xml.schema.ModelGroup

            processSimpleType(type, schemaPrefix);
          }
        //--process groups
          enumeration = schema.enumerateGroups();
          while (enumeration.hasMoreElements()) {
            ModelGroup group= (ModelGroup)enumeration.nextElement();
            processGroup(group, schemaPrefix);
          }
        //--process AttributeGroups
          enumeration = schema.enumerateAttributeGroups();
          while (enumeration.hasMoreElements()) {
View Full Code Here

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

            case Structure.COMPLEX_TYPE:
                _schema = ((ComplexType) _annotated).getSchema();
                break;
            case Structure.MODELGROUP:
                //--resolve reference?
                ModelGroup group = (ModelGroup) _annotated;
                if (group.isReference()) {
                    group = group.getReference();
                }
                _schema = group.getSchema();
                group = null;
                break;
            case Structure.GROUP:
                Structure parent = ((Group) _annotated).getParent();
                short structure = parent.getStructureType();
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.