Package org.apache.ws.jaxme.xs

Examples of org.apache.ws.jaxme.xs.XSGroup


    if (modelGroup == null) {
      XsQName myName = getName();
      if (myName == null) {
        throw new NullPointerException("Missing group name");
      }
      XSGroup group = getXSSchema().getGroup(myName);
      if (group == null) {
        throw new LocSAXException("Unknown group: " + myName, getLocator());
      }
      modelGroup = group;
    }
View Full Code Here


         XSElement element = particle.getElement();
         processElement(element, particle.getMaxOccurs(), false);
      }
      else if(particle.isGroup())
      {
         XSGroup group = particle.getGroup();
         processGroup(group);
      }
      else if(particle.isWildcard())
      {
         if(log.isTraceEnabled())
View Full Code Here

         XSElement element = particle.getElement();
         processElement(element, null, particle.getMaxOccurs());
      }
      else if(particle.isGroup())
      {
         XSGroup group = particle.getGroup();
         processGroup(group);
      }
      else if(particle.isWildcard())
      {
         if(log.isTraceEnabled())
View Full Code Here

      XSParticle particle = pType.getComplexType().getParticle();
      if (particle == null) {
        throw new NullPointerException("Missing group particle for type = " + pType.getName());
      }
      if (particle.isGroup()) {
        XSGroup group = particle.getGroup();
        groupSG = pComplexTypeSG.getTypeSG().getFactory().getGroupSG(group, pComplexTypeSG.getClassContext());
      } else {
        throw new IllegalStateException("Expected internal group");
      }
      isEmpty = false;
View Full Code Here

  public GroupSG getGroup(SchemaSG pController, XsQName pName) throws SAXException {
    GroupSG groupSG = (GroupSG) groupsByName.get(pName);
    if (groupSG != null) {
      return groupSG;
    }
    XSGroup group = getXSSchema().getGroup(pName);
    if (group == null) {
      return null;
    }
    groupSG = pController.getFactory().getGroupSG(group);
    groupsByName.put(pName, groupSG);
View Full Code Here

    protected XsEComplexContent getComplexContent() {
      return complexContent;
    }

    protected XSGroup getGroupByParticle(XsTTypeDefParticle pParticle) throws SAXException {
      XSGroup result;
      XSType myOwner = getOwner();
      XSObjectFactory factory = myOwner.getXSSchema().getXSObjectFactory();
      if (pParticle == null) {
        return null;
      } else if (pParticle instanceof XsEChoice) {
        XsEChoice choice = (XsEChoice) pParticle;
        result = factory.newXSGroup(myOwner, choice);
      } else if (pParticle instanceof XsESequence) {
        XsESequence sequence = (XsESequence) pParticle;
        result = factory.newXSGroup(myOwner, sequence);
      } else if (pParticle instanceof XsTAll) {
        XsTAll all = (XsTAll) pParticle;
        result = factory.newXSGroup(myOwner, all);
      } else if (pParticle instanceof XsTGroupRef) {
        XsTGroupRef groupRef = (XsTGroupRef) pParticle;
        result = factory.newXSGroup(myOwner, groupRef);
      } else {
        throw new IllegalStateException("Unknown TypeDefParticle type: " + pParticle.getClass().getName());
      }
      result.validate();
      return result;
    }
View Full Code Here

        if (type.isSimple()) {
          throw new LocSAXException("Invalid 'restriction': The base type " + getName() + " is simple.", getLocator());
        }
        XsTTypeDefParticle particle = restriction.getTypeDefParticle();

        XSGroup group = getGroupByParticle(particle);
        if (group == null) {
          // TODO: Restriction of the ur-type
          complexContentParticle = null;
        } else {
          complexContentParticle = new XSParticleImpl(group);
        }
        complexContentType = getContentTypeByParticle(particle, group);
        attributes = XSAttributeGroupImpl.getAttributes(XSTypeImpl.this, restriction);
        restrictedType = type;
      } else {
        XsQName base = extension.getBase();
        if (base == null) {
          throw new LocSAXException("Invalid 'extension': Missing 'base' attribute", getLocator());
        }
        XSType type = getXSSchema().getType(base);
        if (type == null) {
          throw new LocSAXException("Invalid 'extension': Unknown base type " + base, getLocator());
        }
        if (type.isSimple()) {
          throw new LocSAXException("Invalid 'extension': The base type " + base + " is simple.", getLocator());
        }
        XSComplexType extendedComplexType = type.getComplexType();
        if (extendedComplexType.hasSimpleContent()) {
          throw new LocSAXException("Invalid 'extension': The base type " + base + " has simple content.",
                                       getLocator());
        }
        XsTTypeDefParticle particle = extension.getTypeDefParticle();
        XSGroup group = getGroupByParticle(particle);
        XsComplexContentType groupType = getContentTypeByParticle(particle, group);

        if (XsComplexContentType.EMPTY.equals(groupType)) {
          if (type == XSAnyType.getInstance()) {
            complexContentType = null;
            complexContentParticle = null;
          } else {
            complexContentType = extendedComplexType.getComplexContentType();
            complexContentParticle = extendedComplexType.getParticle();
          }
        } else if (extendedComplexType.isEmpty()) {
          complexContentType = groupType;
          complexContentParticle = new XSParticleImpl(group);
        } else {
          XSGroup sequenceGroup = new ExtensionGroup(pOwner, new XSParticle[]{extendedComplexType.getParticle(), new XSParticleImpl(group)});
          complexContentParticle = new XSParticleImpl(sequenceGroup);
          complexContentType = groupType;
        }

        XSAttributable[] inheritedAttributes = extendedComplexType.getAttributes();
View Full Code Here

      setParticle(pType.isMixed() ? XsComplexContentType.MIXED : XsComplexContentType.EMPTY, null);
    }
    public XSSequenceComplexTypeImpl(XSType pOwner, XsTComplexType pType, XsESequence pSequence) throws SAXException {
      super(pOwner, pType);
      sequence = pSequence;
      XSGroup group = pOwner.getXSSchema().getXSObjectFactory().newXSGroup(pOwner, sequence);
      group.validate();
      XSParticleImpl particle = new XSParticleImpl(group);
      particle.setMaxOccurs(pSequence.getMaxOccurs());
      particle.setMinOccurs(pSequence.getMinOccurs());
      if (group.getParticles().length == 0) {
        setParticle(XsComplexContentType.EMPTY, particle);
      } else {
        setParticle(pType.isMixed() ? XsComplexContentType.MIXED : XsComplexContentType.ELEMENT_ONLY, particle);
      }
    }
View Full Code Here

    private final XsEChoice choice;

    public XSChoiceComplexTypeImpl(XSType pOwner, XsTComplexType pType, XsEChoice pChoice) throws SAXException {
      super(pOwner, pType);
      choice = pChoice;
      XSGroup group = pOwner.getXSSchema().getXSObjectFactory().newXSGroup(pOwner, choice);
      group.validate();
      XSParticleImpl particle = new XSParticleImpl(group);
      particle.setMaxOccurs(pChoice.getMaxOccurs());
      particle.setMinOccurs(pChoice.getMinOccurs());     
      if (group.getParticles().length == 0) {
        throw new LocSAXException("The complex type must not have an empty element group, as it is a choice.",
                                     choice.getLocator());
      } else {
        setParticle(pType.isMixed() ? XsComplexContentType.MIXED : XsComplexContentType.ELEMENT_ONLY, particle);
      }
View Full Code Here

    private final XsTAll all;

    public XSAllComplexTypeImpl(XSType pOwner, XsTComplexType pType, XsTAll pAll) throws SAXException {
      super(pOwner, pType);
      all = pAll;
      XSGroup group = pOwner.getXSSchema().getXSObjectFactory().newXSGroup(pOwner, all);
      group.validate();
      XSParticleImpl particle = new XSParticleImpl(group);
      particle.setMaxOccurs(pAll.getMaxOccurs());
      particle.setMinOccurs(pAll.getMinOccurs());
      if (group.getParticles().length == 0) {
        setParticle(XsComplexContentType.EMPTY, particle);
      } else {
        setParticle(pType.isMixed() ? XsComplexContentType.MIXED : XsComplexContentType.ELEMENT_ONLY, particle);
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.XSGroup

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.