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

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


   */
  private void generateCreateMethods(JavaSource pJs, ParticleSG pParticle,
                    String pName, Set pContextSet)
      throws SAXException {
    if (pParticle.isGroup()) {
      GroupSG group = pParticle.getGroupSG();
      generateCreateMethods(pJs, group.getParticles(), pName, pContextSet);
    } else if (pParticle.isElement()) {
      ObjectSG oSG = pParticle.getObjectSG();
      if (oSG.isGlobal()) {
        return// Will be generated elsewhere
      }
View Full Code Here


    } else {
      ComplexContentSG ccSG = pController.getComplexContentSG();
      if (ccSG.isEmpty()) {
        return new EmptyElementHandlerSG(pController, pJs);
      } else {
        GroupSG group = ccSG.getRootParticle().getGroupSG();
        if (group.isSequence()) {
          return new SequenceHandlerSG(pController, pJs);
        } else if (group.isChoice()) {
          return new ChoiceHandlerSG(pController, pJs);
        } else if (group.isAll()) {
          return new AllHandlerSG(pController, pJs);
        } else {
          throw new IllegalStateException("Invalid group type");
        }
      }
View Full Code Here

    assertTrue(items.isGlobalType());
    assertTrue(items.isComplex());
    ComplexTypeSG itemsComplex = items.getComplexTypeSG();
    assertTrue(!itemsComplex.hasSimpleContent());
    ComplexContentSG itemsComplexContent = itemsComplex.getComplexContentSG();
    GroupSG group = itemsComplexContent.getGroupSG();
    assertTrue(group.isSequence());
    // Items.item
    ParticleSG[] itemsChildren = group.getParticles();
    assertEquals(1, itemsChildren.length);
    ParticleSG item = itemsChildren[0];
    assertTrue(item.isElement());
    assertEquals(new XsQName((String) null, "item"), item.getObjectSG().getName());
    assertEquals(0, item.getMinOccurs());
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(group);
          groups.put(group, handler);
        }
      }
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

                                                    + ", 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("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

    } else {
      ComplexContentSG ccSG = pController.getComplexContentSG();
      if (ccSG.isEmpty()) {
        return new EmptyElementBeanSG(pController, pJs);
      } else {
        GroupSG group = ccSG.getGroupSG();
        if (group.isAll()) {
          return new AllBeanSG(pController, pJs);
        } else if (group.isChoice()) {
          return new ChoiceBeanSG(pController, pJs);
        } else if (group.isSequence()) {
          return new SequenceBeanSG(pController, pJs);
        } else {
          throw new IllegalStateException("Invalid particle type");
        }
      }
View Full Code Here

    } else {
      ComplexContentSG ccSG = pController.getComplexContentSG();
      if (ccSG.isEmpty()) {
        return new EmptyElementDriverSG(pController, pSource);
      } else {
        GroupSG group = ccSG.getGroupSG();
        if (group.isSequence()) {
          return new SequenceDriverSG(pController, pSource);
        } else if (group.isChoice()) {
          return new ChoiceDriverSG(pController, pSource);
        } else if (group.isAll()) {
          return new AllDriverSG(pController, pSource);
        } else {
          throw new IllegalStateException("Invalid group type");
        }
      }
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.