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

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


  private DriverSG newSerializerSG(ComplexTypeSG pController, JavaSource pSource)
      throws SAXException {
    if (pController.hasSimpleContent()) {
      return new SimpleContentDriverSG(pController, pSource);
    } 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()) {
View Full Code Here


      throws SAXException {
    pSource.addImplements(JMSAXDriver.class);
    DriverSG serializerSG = newSerializerSG(pController, pSource);
    serializerSG.generate();
    if (!pController.hasSimpleContent()) {
      ComplexContentSG ccSG = pController.getComplexContentSG();
      ParticleSG[] particles = ccSG.getElementParticles();
      for (int i = 0;  i < particles.length;  i++) {
        ParticleSG particle = particles[i];
        TypeSG tSG = particle.getObjectSG().getTypeSG();
        if (tSG.isComplex()  &&  !tSG.isGlobalClass()) {
          tSG.getComplexTypeSG().getXMLSerializer(pSource);
View Full Code Here

                   JavaSource pJs)
      throws SAXException {
    if (pController.hasSimpleContent()) {
      return new SimpleContentHandlerSG(pController, pJs);
    } else {
      ComplexContentSG ccSG = pController.getComplexContentSG();
      if (ccSG.isEmpty()) {
        return new EmptyElementHandlerSG(pController, pJs);
      } else {
        GroupSG group = ccSG.getGroupSG();
        if (group.isSequence()) {
          return new SequenceHandlerSG(pController, pJs);
        } else if (group.isChoice()) {
          return new ChoiceHandlerSG(pController, pJs);
        } else if (group.isAll()) {
View Full Code Here

  private void createXMLHandler(ComplexTypeSG pController, JavaSource pJs) throws SAXException {
    pJs.addExtends(JMSAXElementParser.class);
    HandlerSG handlerSG = newHandlerSG(pController, pJs);
    handlerSG.generate();
    if (!pController.hasSimpleContent()) {
      ComplexContentSG ccSG = pController.getComplexContentSG();
      ParticleSG[] particles = ccSG.getElementParticles();
      for (int i = 0;  i < particles.length;  i++) {
        ParticleSG particle = particles[i];
        TypeSG tSG = particle.getObjectSG().getTypeSG();
        if (tSG.isComplex()  &&  !tSG.isGlobalClass()) {
          tSG.getComplexTypeSG().getXMLHandler(pJs);
View Full Code Here

    AttributeSG[] attributes = pTypeSG.getAttributes();
    if (attributes != null) {
      allChilds.addAll(Arrays.asList(attributes));
    }
    if (!pTypeSG.hasSimpleContent()) {
      ComplexContentSG cct = pTypeSG.getComplexContentSG();
      GroupSG groupSG = cct.getGroupSG();
      ParticleSG[] childs = groupSG.getParticles();
      if (childs != null) {
        for (int i = 0;  i < childs.length;  i++) {
          ParticleSG child = childs[i];
          // Accept only simple elements
View Full Code Here

      throws SAXException {
    ComplexTypeSG ctSG = pType.getComplexTypeSG();
    if (ctSG.hasSimpleContent()) {
      return; // No elements contained
    }
    ComplexContentSG ccSG = ctSG.getComplexContentSG();
    if (ccSG.isEmpty()) {
      return;
    }
    GroupSG group = ccSG.getGroupSG();
    generateCreateMethods(pJs, group.getParticles(), pName, pContextSet);
  }
View Full Code Here

      if (qName != null) {
        names.add(qName);
      }
    }
    if (!pController.hasSimpleContent()) {
      ComplexContentSG myComplexContentSG = pController.getComplexContentSG();
      GroupSG groupSG = myComplexContentSG.getGroupSG();
      if (groupSG != null) { // Check required, in case the element doesn't have any childs.
        ParticleSG[] particles = groupSG.getParticles();
        for (int i = 0;  i < particles.length;  i++) {
          if (particles[i].isElement()) {
            names.add(particles[i].getObjectSG().getName());
View Full Code Here

    assertEquals(new XsQName((String) null, "c"), e3.getName());
    TypeSG t3 = e3.getTypeSG();
    assertTrue(t3.isComplex());
    ComplexTypeSG ct3 = t3.getComplexTypeSG();
    assertTrue(!ct3.hasSimpleContent());
    ComplexContentSG cct3 = ct3.getComplexContentSG();
    ParticleSG[] childs = cct3.getGroupSG().getParticles();
    assertEquals(2, childs.length);
    assertTrue(childs[0].isElement());
    ObjectSG child1 = childs[0].getObjectSG();
    assertEquals(new XsQName((String) null, "a"), child1.getName());
    assertTrue(childs[1].isElement());
View Full Code Here

    assertEquals(new XsQName((String) null, "Items"), items.getName());
    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];
View Full Code Here

      if (qName != null) {
        names.add(qName);
      }
    }
    if (!pController.hasSimpleContent()) {
      ComplexContentSG myComplexContentSG = pController.getComplexContentSG();
      GroupSG groupSG = myComplexContentSG.getGroupSG();
      if (groupSG != null) { // Check required, in case the element doesn't have any childs.
        ParticleSG[] particles = groupSG.getParticles();
        for (int i = 0;  i < particles.length;  i++) {
          if (particles[i].isElement()) {
            names.add(particles[i].getObjectSG().getName());
View Full Code Here

TOP

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

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.