Examples of ObjectSG


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

        if (groupSG == null) {
          throw new IllegalStateException("GroupSG not created");
        }
        groups.add(groupSG);
      } else if (o instanceof XSElement) {
        ObjectSG objectSG = pController.getElement(((XSElement) o).getName());
        if (objectSG == null) {
          throw new IllegalStateException("ObjectSG not created");
        }
        objects.add(objectSG);
        elements.add(objectSG);
View Full Code Here

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

  public ObjectSG[] getObjects(SchemaSG pController) throws SAXException {
    return objectsByOrder;
  }

  public ObjectSG getElement(SchemaSG pController, XsQName pName) throws SAXException {
    ObjectSG objectSG = (ObjectSG) elementsByName.get(pName);
    if (objectSG != null) {
      return objectSG;
    }
    XSElement element = getXSSchema().getElement(pName);
    if (element == null) {
View Full Code Here

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

    Set contextSet = new HashSet();
    for (Iterator iter = pContextList.iterator();  iter.hasNext()) {
      Object o = iter.next();
      TypeSG typeSG;
      if (o instanceof ObjectSG) {
        ObjectSG objectSG = ((ObjectSG) o);
        typeSG = objectSG.getTypeSG();
        generateCreateMethod(js, objectSG.getClassContext());
        //NB: we don't have to check for duplicate element names since that would violate the XSD spec
      } else if (o instanceof TypeSG) {
        typeSG = (TypeSG) o;
      } else {
        continue;
View Full Code Here

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

    log.finest(mName, "->", pSource.getQName());
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < particles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        ObjectSG elementSG = particle.getObjectSG();
        TypeSG typeSG = elementSG.getTypeSG();
        if (!typeSG.isGlobalType()  &&  !typeSG.isGlobalClass()  &&  typeSG.isComplex()) {
            ComplexTypeSG complexTypeSG = typeSG.getComplexTypeSG();
            complexTypeSG.getXMLInterface(pSource);
        }
      } else if (particle.isGroup()) {
View Full Code Here

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

    log.finest(mName, "->", new Object[]{pSource.getQName()});
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < particles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        ObjectSG elementSG = particle.getObjectSG();
        TypeSG typeSG = elementSG.getTypeSG();
        if (!typeSG.isGlobalType()  &&  !typeSG.isGlobalClass()  &&  typeSG.isComplex()) {
          ComplexTypeSG complexTypeSG = typeSG.getComplexTypeSG();
          complexTypeSG.getXMLImplementation(pSource);
        }
      } else if (particle.isGroup()) {
View Full Code Here

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

    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (!particle.isElement()) {
        continue;
      }
      ObjectSG child = particle.getObjectSG();
      if (!child.getTypeSG().isComplex()) {
        continue;
      }
      if (jm == null) {
        jm = pSource.newJavaMethod("init", JavaQNameImpl.VOID, JavaSource.PUBLIC);
        pFactory = jm.addParam(JAXBContextImpl.class, "pFactory");
        jm.addLine("super.init(", pFactory, ");");
        jm.addThrows(JAXBException.class);
      }
      String serializerName = getXMLSerializersFieldName(particle.getPropertySG());
      Context myClassContext = child.getTypeSG().getComplexTypeSG().getClassContext();
      JavaQName serializerClass = myClassContext.getXMLSerializerName();
      pSource.newJavaField(serializerName, serializerClass, JavaSource.PRIVATE);
    }
    return jm;
  }
View Full Code Here

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

    getXMLSerializersMarshalChildsMethod(pController, pSource);
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        ObjectSG objectSG = particle.getObjectSG();
        TypeSG typeSG = objectSG.getTypeSG();
        if (typeSG.isComplex()  &&  !typeSG.isGlobalClass()) {
          typeSG.getComplexTypeSG().getXMLSerializer(pSource);
        }
      }
    }
View Full Code Here

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

  private void getXMLHandlersElements(GroupSG pController, JavaSource pSource) throws SAXException {
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        ObjectSG objectSG = particle.getObjectSG();
        TypeSG typeSG = objectSG.getTypeSG();
        if (typeSG.isComplex()  &&  !typeSG.isGlobalClass()) {
          typeSG.getComplexTypeSG().getXMLHandler(pSource);
        }
      }
    }
View Full Code Here

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

    DirectAccessible pData = null;
    ParticleSG[] myParticles = pController.getParticles();
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG particle = myParticles[i];
      if (particle.isElement()) {
        ObjectSG objectSG = particle.getObjectSG();
        TypeSG typeSG = objectSG.getTypeSG();
        if (typeSG.isComplex()) {
          if (jm == null) {
            jm = pSource.newJavaMethod("init", JavaQNameImpl.VOID, JavaSource.PUBLIC);
            pData = jm.addParam(JMHandler.Data.class, "pData");
            jm.addThrows(JAXBException.class);
            jm.addLine("super.init(", pData, ");");
          }

          String f = particle.getPropertySG().getXMLFieldName();
          String handlerFieldName = "__handler_" + f;
          String handlerMethodName = getXMLHandlersMethodName(particle.getPropertySG());

          JavaField jf = pSource.newJavaField(handlerFieldName, JMHandler.class, JavaSource.PRIVATE);
          JavaMethod jm2 = pSource.newJavaMethod(handlerMethodName, JMHandler.class, "protected");
          jm2.addThrows(SAXException.class);
          jm2.addIf(handlerFieldName, " == null");
         
          ComplexTypeSG childSG = typeSG.getComplexTypeSG();
          JavaQName handlerClassName = childSG.getClassContext().getXMLHandlerName();
          jm2.addTry();
          if (typeSG.isGlobalClass()) {
            JavaQName interfaceName;
            if (objectSG.isGlobal()) {
                interfaceName = objectSG.getClassContext().getXMLInterfaceName();
            } else {
              interfaceName = childSG.getClassContext().getXMLInterfaceName();
            }
            jm2.addLine(handlerFieldName, " = getData().getFactory().getJMHandler(",
                        interfaceName, ".class);");
View Full Code Here

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

    jm.addSwitch(pStateVar);
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG child = myParticles[i];
      // TODO: process group case properly.
      if (myParticles[i].isGroup()) continue;
      ObjectSG osg = child.getObjectSG();
      TypeSG childType = osg.getTypeSG();
      jm.addCase(Integer.toString(3+i));
      jm.addIf(pHandlerVar, " != null");
      jm.addLine(pHandlerVar, ".endDocument();");
      jm.addEndIf();
      Object v;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.