Package org.apache.ws.jaxme.xs.xml

Examples of org.apache.ws.jaxme.xs.xml.XsTLocalElement


                if (!elements.containsKey(name)) {
                  throw new SAXParseException("Element " + pElement.getName()
                                                + " references an undeclared element " + name,
                                                pLocator);
                }
                XsTLocalElement e = pGroup.createElement();
                e.setRef(new XsQName(getTargetNamespace(), getLocalPart(name)));
                setMultiplicity(e, multiplicity);
            } else if (o instanceof ChildToken) {
                ChildToken ct = (ChildToken) o;
                XsTExplicitGroup group;
                if (ct.type == ChildToken.SEQUENCE) {
View Full Code Here


                } else {
                  name = pModel.substring(0, offset).trim();
                    pModel = pModel.substring(offset);
                }
                if (elements.containsKey(name)) {
                  XsTLocalElement e = choice.createElement();
                    e.setRef(new XsQName(getTargetNamespace(), getLocalPart(name)));
                } else {
                  throw new SAXParseException("Element " + pElement.getName()
                                                + " references element " + name
                                                + ", which is not declared",
                                                pLocator);
View Full Code Here

      namedGroup.setName(new XsNCName(suggestion.getLocalName()));
      XsTSimpleExplicitGroup choice = namedGroup.createChoice();
      XSElement[] members = group.getMembers();
      for (int j = 0;  j < members.length;  j++) {
        XSElement member = members[j];
        XsTLocalElement memberElement = choice.createElement();
        memberElement.setRef(member.getName());
      }
     
      XSGroupImpl xsGroup = (XSGroupImpl) getSchema().getXSObjectFactory().newXSGroup(pSchema, namedGroup);
      pSchema.add(xsGroup);
      head.setSubstitutionGroup(xsGroup);
View Full Code Here

  protected void addParticle(XsTNestedParticle pParticle) {
    particles.add(pParticle);
  }

  public XsTLocalElement createElement() {
    XsTLocalElement element = getObjectFactory().newXsTLocalElement(this);
    addParticle(element);
    return element;
  }
View Full Code Here

      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, sequence);
      group.validate();
      p = new XSParticleImpl(group);
    } else {
      XsTGroupRef groupRef = null;
      XsTLocalElement localElement = null;
      if (pParticle instanceof XsTGroupRef) {
        groupRef = (XsTGroupRef) pParticle;
      } else if (pParticle instanceof XsTLocalElement) {
        localElement = (XsTLocalElement) pParticle;
        // May be the referenced element is the head of a substitution group
        XsQName ref = localElement.getRef();
        if (ref != null) {
          XSElement referencedElement = getXSSchema().getElement(ref);
          if (referencedElement == null) {
            throw new LocSAXException("The referenced element " + ref + " is undefined.", localElement.getLocator());
          }
          XSGroup substitutedGroup = referencedElement.getSubstitutionGroup();
          if (substitutedGroup != null  &&  substitutedGroup != this) {
            XsObject parent = localElement.getParentObject();
            XsTGroupRefImpl groupRefImpl = (XsTGroupRefImpl) localElement.getObjectFactory().newXsTGroupRef(parent);
            groupRefImpl.setRef(substitutedGroup.getName());
            int maxOccurs = localElement.getMaxOccurs();
            if (maxOccurs == -1) {
              groupRefImpl.setMaxOccurs("unbounded");
            } else {
              groupRefImpl.setMaxOccurs(Integer.toString(maxOccurs));
            }
            groupRefImpl.setMinOccurs(localElement.getMinOccurs());
            groupRef = groupRefImpl;
          }
        }
      } else {
        throw new IllegalStateException("Unknown particle type: " + pParticle.getClass().getName());
View Full Code Here

      namedGroup.setName(new XsNCName(suggestion.getLocalName()));
      XsTSimpleExplicitGroup choice = namedGroup.createChoice();
      XSElement[] members = group.getMembers();
      for (int j = 0;  j < members.length;  j++) {
        XSElement member = members[j];
        XsTLocalElement memberElement = choice.createElement();
        memberElement.setRef(member.getName());
      }

      XSGroupImpl xsGroup = (XSGroupImpl) getSchema().getXSObjectFactory().newXSGroup(pSchema, namedGroup);
      pSchema.add(xsGroup);
      head.setSubstitutionGroup(xsGroup);
View Full Code Here

      namedGroup.setName(new XsNCName(suggestion.getLocalName()));
      XsTSimpleExplicitGroup choice = namedGroup.createChoice();
      XSElement[] members = group.getMembers();
      for (int j = 0;  j < members.length;  j++) {
        XSElement member = members[j];
        XsTLocalElement memberElement = choice.createElement();
        memberElement.setRef(member.getName());
      }

      XSGroupImpl xsGroup = (XSGroupImpl) getSchema().getXSObjectFactory().newXSGroup(pSchema, namedGroup);
      pSchema.add(xsGroup);
      head.setSubstitutionGroup(xsGroup);
View Full Code Here

      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, sequence);
      group.validate();
      p = new XSParticleImpl(group);
    } else {
      XsTGroupRef groupRef = null;
      XsTLocalElement localElement = null;
      if (pParticle instanceof XsTGroupRef) {
        groupRef = (XsTGroupRef) pParticle;
      } else if (pParticle instanceof XsTLocalElement) {
        localElement = (XsTLocalElement) pParticle;
        // May be the referenced element is the head of a substitution group
        XsQName ref = localElement.getRef();
        if (ref != null) {
          XSElement referencedElement = getXSSchema().getElement(ref);
          if (referencedElement == null) {
            throw new LocSAXException("The referenced element " + ref + " is undefined.", localElement.getLocator());
          }
          XSGroup substitutedGroup = referencedElement.getSubstitutionGroup();
          if (substitutedGroup != null  &&  substitutedGroup != this) {
            XsObject parent = localElement.getParentObject();
            XsTGroupRefImpl groupRefImpl = (XsTGroupRefImpl) localElement.getObjectFactory().newXsTGroupRef(parent);
            groupRefImpl.setRef(substitutedGroup.getName());
            int maxOccurs = localElement.getMaxOccurs();
            if (maxOccurs == -1) {
              groupRefImpl.setMaxOccurs("unbounded");
            } else {
              groupRefImpl.setMaxOccurs(Integer.toString(maxOccurs));
            }
            groupRefImpl.setMinOccurs(localElement.getMinOccurs());
            groupRef = groupRefImpl;
          }
        }
      } else {
        throw new IllegalStateException("Unknown particle type: " + pParticle.getClass().getName());
View Full Code Here

      namedGroup.setName(new XsNCName(suggestion.getLocalName()));
      XsTSimpleExplicitGroup choice = namedGroup.createChoice();
      XSElement[] members = group.getMembers();
      for (int j = 0;  j < members.length;  j++) {
        XSElement member = members[j];
        XsTLocalElement memberElement = choice.createElement();
        memberElement.setRef(member.getName());
      }
     
      XSGroupImpl xsGroup = (XSGroupImpl) getSchema().getXSObjectFactory().newXSGroup(pSchema, namedGroup);
      pSchema.add(xsGroup);
      head.setSubstitutionGroup(xsGroup);
View Full Code Here

                if (!elements.containsKey(name)) {
                  throw new SAXParseException("Element " + pElement.getName()
                                                + " references an undeclared element " + name,
                                                pLocator);
                }
                XsTLocalElement e = pGroup.createElement();
                e.setRef(new XsQName(getTargetNamespace(), getLocalPart(name)));
                setMultiplicity(e, multiplicity);
            } else if (o instanceof ChildToken) {
                ChildToken ct = (ChildToken) o;
                XsTExplicitGroup group;
                if (ct.type == ChildToken.SEQUENCE) {
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.xml.XsTLocalElement

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.