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

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


      addParticle(pModelGroup, pParticles[i]);
    }
  }

  protected void addParticle(XSModelGroupImpl pModelGroup, XsTParticle pParticle) throws SAXException {
    XsAGOccurs occurs;
    XSParticleImpl p;
    if (pParticle instanceof XsTAll) {
      XsTAll all = (XsTAll) pParticle;
      occurs = all;
      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, all);
      group.validate();
      p = new XSParticleImpl(group);
    } else if (pParticle instanceof XsTNestedParticle) {
      addParticle(pModelGroup, (XsTNestedParticle) pParticle);
      return;
    } else {
      throw new IllegalStateException("Unknown particle type: " + pParticle.getClass().getName());
    }
    pModelGroup.addParticle(p);
    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }
View Full Code Here


    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }

  protected void addParticle(XSModelGroupImpl pModelGroup, XsTNestedParticle pParticle) throws SAXException {
    XsAGOccurs occurs;
    XSParticleImpl p;
    if (pParticle instanceof XsEAny) {
      XsEAny any = (XsEAny) pParticle;
      occurs = any;
      XSAny wildcard = getXSSchema().getXSObjectFactory().newXSAny(this, any);
      wildcard.validate();
      p = new XSParticleImpl(wildcard);
    } else if (pParticle instanceof XsEChoice) {
      XsEChoice choice = (XsEChoice) pParticle;
      occurs = choice;
      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, choice);
      group.validate();
      p = new XSParticleImpl(group);
    } else if (pParticle instanceof XsESequence) {
      XsESequence sequence = (XsESequence) pParticle;
      occurs = sequence;
      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());
      }
      if (groupRef == null) {
        occurs = localElement;
        XSElement element = getXSSchema().getXSObjectFactory().newXSElement(this, localElement);
        element.validate();
        p = new XSParticleImpl(element);
      } else {
        occurs = groupRef;
        XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, groupRef);
        group.validate();
        p = new XSParticleImpl(group);
      }
    }
    pModelGroup.addParticle(p);
    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }
View Full Code Here

      addParticle(pModelGroup, pParticles[i]);
    }
  }

  protected void addParticle(XSModelGroupImpl pModelGroup, XsTParticle pParticle) throws SAXException {
    XsAGOccurs occurs;
    XSParticleImpl p;
    if (pParticle instanceof XsTAll) {
      XsTAll all = (XsTAll) pParticle;
      occurs = all;
      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, all);
      group.validate();
      p = new XSParticleImpl(group);
    } else if (pParticle instanceof XsTNestedParticle) {
      addParticle(pModelGroup, (XsTNestedParticle) pParticle);
      return;
    } else {
      throw new IllegalStateException("Unknown particle type: " + pParticle.getClass().getName());
    }
    pModelGroup.addParticle(p);
    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }
View Full Code Here

    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }

  protected void addParticle(XSModelGroupImpl pModelGroup, XsTNestedParticle pParticle) throws SAXException {
    XsAGOccurs occurs;
    XSParticleImpl p;
    if (pParticle instanceof XsEAny) {
      XsEAny any = (XsEAny) pParticle;
      occurs = any;
      XSAny wildcard = getXSSchema().getXSObjectFactory().newXSAny(this, any);
      wildcard.validate();
      p = new XSParticleImpl(wildcard);
    } else if (pParticle instanceof XsEChoice) {
      XsEChoice choice = (XsEChoice) pParticle;
      occurs = choice;
      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, choice);
      group.validate();
      p = new XSParticleImpl(group);
    } else if (pParticle instanceof XsESequence) {
      XsESequence sequence = (XsESequence) pParticle;
      occurs = sequence;
      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());
      }
      if (groupRef == null) {
        occurs = localElement;
        XSElement element = getXSSchema().getXSObjectFactory().newXSElement(this, localElement);
        element.validate();
        p = new XSParticleImpl(element);
      } else {
        occurs = groupRef;
        XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, groupRef);
        group.validate();
        p = new XSParticleImpl(group);
      }
    }
    pModelGroup.addParticle(p);
    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }
View Full Code Here

      addParticle(pModelGroup, pParticles[i]);
    }
  }

  protected void addParticle(XSModelGroupImpl pModelGroup, XsTParticle pParticle) throws SAXException {
    XsAGOccurs occurs;
    XSParticleImpl p;
    if (pParticle instanceof XsTAll) {
      XsTAll all = (XsTAll) pParticle;
      occurs = all;
      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, all);
      group.validate();
      p = new XSParticleImpl(group);
    } else if (pParticle instanceof XsTNestedParticle) {
      addParticle(pModelGroup, (XsTNestedParticle) pParticle);
      return;
    } else {
      throw new IllegalStateException("Unknown particle type: " + pParticle.getClass().getName());
    }
    pModelGroup.addParticle(p);
    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }
View Full Code Here

    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }

  protected void addParticle(XSModelGroupImpl pModelGroup, XsTNestedParticle pParticle) throws SAXException {
    XsAGOccurs occurs;
    XSParticleImpl p;
    if (pParticle instanceof XsEAny) {
      XsEAny any = (XsEAny) pParticle;
      occurs = any;
      XSAny wildcard = getXSSchema().getXSObjectFactory().newXSAny(this, any);
      wildcard.validate();
      p = new XSParticleImpl(wildcard);
    } else if (pParticle instanceof XsEChoice) {
      XsEChoice choice = (XsEChoice) pParticle;
      occurs = choice;
      XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, choice);
      group.validate();
      p = new XSParticleImpl(group);
    } else if (pParticle instanceof XsESequence) {
      XsESequence sequence = (XsESequence) pParticle;
      occurs = sequence;
      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());
      }
      if (groupRef == null) {
        occurs = localElement;
        XSElement element = getXSSchema().getXSObjectFactory().newXSElement(this, localElement);
        element.validate();
        p = new XSParticleImpl(element);
      } else {
        occurs = groupRef;
        XSGroup group = getXSSchema().getXSObjectFactory().newXSGroup(this, groupRef);
        group.validate();
        p = new XSParticleImpl(group);
      }
    }
    pModelGroup.addParticle(p);
    p.setMaxOccurs(occurs.getMaxOccurs());
    p.setMinOccurs(occurs.getMinOccurs());
  }
View Full Code Here

TOP

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

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.