Package org.apache.ws.jaxme.generator.sg

Examples of org.apache.ws.jaxme.generator.sg.GroupSG


  private GroupHandlerSG newGroupHandlerSG(ParticleSG pParticle, String pName) throws SAXException {
    JavaSource js = getJavaSource();
    JavaInnerClass jic = js.newJavaInnerClass(pName, JavaSource.PUBLIC);
    jic.addExtends(JMSAXGroupParser.class);
    GroupSG group = pParticle.getGroupSG();
    if (group.isSequence()) {
      return new SequenceHandlerSG(outerHandler, ctSG, pParticle, jic);
    } else if (group.isChoice()) {
      return new ChoiceHandlerSG(outerHandler, ctSG, pParticle, jic);
    } else if (group.isAll()) {
      return new AllHandlerSG(outerHandler, ctSG, pParticle, jic);
    } else {
      throw new IllegalStateException("Invalid group type");
    }
  }
View Full Code Here


  private void findGroups(ParticleSG[] pParticles) throws SAXException {
    for (int i = 0;  i < pParticles.length;  i++) {
      ParticleSG particle = pParticles[i];
      if (particle.isGroup()) {
        GroupSG group = particle.getGroupSG();
        if (!groups.containsKey(group)) {
          GroupHandlerSG handler = newGroupHandlerSG(particle);
          groups.put(group, handler);
        }
      } else if (particle.isElement()) {
View Full Code Here

  protected boolean isRequiredParticle(ParticleSG particleSG) throws SAXException {
    if (particleSG.getMinOccurs() == 0) {
      return false;
    } else {
      if (particleSG.isGroup()) {
        GroupSG group = particleSG.getGroupSG();
        ParticleSG[] particles = group.getParticles();
        if (group.isChoice()) {
          for (int i = 0;  i < particles.length;  i++) {
            if (!isRequiredParticle(particles[i])) {
              return false;
            }
          }
View Full Code Here

              ".equals(", getParamLocalName(), ")");
        acceptParticle(pJm, i);
        handleStartOfChildElement(pUnmarshallerHandler, pJm, particle);
        pJm.addLine("return true;");
      } else if (particle.isGroup()) {
        GroupSG gSG = particle.getGroupSG();
        GroupHandlerSG handlerSG = getGroupHandlerSG(gSG);
        pJm.addIf(i == pFrom,
              pUnmarshallerHandler, ".testGroupParser(new ",
              handlerSG.getJavaSource().getQName(), "(), ",
              getParamNamespaceURI(), ", ", getParamLocalName(),
View Full Code Here

    jc.addLine("These are the indices, to which the child elements are");
    jc.addLine("mapped:");
    for (int i = 0;  i < particles.length;  i++) {
      ParticleSG particle = particles[i];
      if (particle.isGroup()) {
        GroupSG group = particle.getGroupSG();
        if (group.isGlobal()) {
          jc.addLine(" " + i + " = The nested group " + group.getName());
        } else {
          jc.addLine(" " + i + " = An anonymous nested group.");
        }
      } else if (particle.isElement()) {
        jc.addLine(" " + i + " = The child element " + particle.getObjectSG().getName());
View Full Code Here

                                                    + ", which aren't references to "
                                                    + " a common global element, are present in a common"
                                                    + " complex type. (JAXB 1.0, 5.9.7.4.a) Use jaxb:property/@name"
                                                    + " for customization.", pController.getLocator());
                    }
                    GroupSG group = pParticle.getClosestCommonAnchestor(pParticle);
                    if (group.isSequence()) {
                        throw new SAXParseException("Multiple element particles named " + name
                                                    + " are contained in a common sequence."
                                                    + " (JAXB 1.0, 5.9.7.4.b) Use jaxb:property/@name"
                                                    + " for customization.", pController.getLocator());
                    }
View Full Code Here

        }
        ParticleSG getParticleSG() { return particle; }
        Object[] getStack() { return stack; }
        GroupSG getClosestCommonAnchestor(Particle pParticle) {
            int len = Math.min(stack.length, pParticle.stack.length);
            GroupSG anchestor = stack[0];
            for (int i = 1;  i < len;  i++) {
                if (stack[i] != pParticle.stack[i]) {
                    break;
                }
            }
View Full Code Here

    jc.addLine("The current state. The following values are valid states:");
    jc.addLine(" 0 = Before parsing the element");
    for (int i = 0;  i < particles.length;  i++) {
      ParticleSG particle = particles[i];
      if (particle.isGroup()) {
        GroupSG group = particle.getGroupSG();
        if (group.isGlobal()) {
          jc.addLine(" " + getState(i) + " = While parsing the nested group " + group.getName());
        } else {
          jc.addLine(" " + getState(i) + " = While parsing the nested group " + GroupUtil.getGroupName(group));
        }
      } else if (particle.isElement()) {
        jc.addLine(" " + getState(i) + " = While or after parsing the child element " + particle.getObjectSG().getName());
View Full Code Here

        if (typeSG == null) {
          throw new IllegalStateException("TypeSG not created");
        }
        types.add(typeSG);
      } else if (o instanceof XSGroup) {
        GroupSG groupSG = pController.getGroup(((XSGroup) o).getName());
        if (groupSG == null) {
          throw new IllegalStateException("GroupSG not created");
        }
        groups.add(groupSG);
      } else if (o instanceof XSElement) {
View Full Code Here

  public GroupSG[] getGroups(SchemaSG pController) throws SAXException {
    return groupsByOrder;
  }

  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) {
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.generator.sg.GroupSG

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.