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

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


    }
    return new JAXBObjectSG(pController, schemaSG, pElement);
  }
 
  public ObjectSG getObjectSG(SGFactory pController, XSElement pElement) throws SAXException {
    ObjectSG result = (ObjectSG) objects.get(pElement);
    if (result == null) {
      ObjectSGChain chain = (ObjectSGChain) pController.newObjectSG(pElement);
      result = new ObjectSGImpl(chain);
      objects.put(pElement, result);
      objectsByOrder.add(result);
      result.init();
    }
    return result;
  }
View Full Code Here


      return new JAXBObjectSG(pController, schemaSG, pAny);
  }

  public ObjectSG getObjectSG(SGFactory pController, XSAny pAny, Context pContext) throws SAXException {
      ObjectSGChain chain = (ObjectSGChain) pController.newObjectSG(pAny);
      ObjectSG result = new ObjectSGImpl(chain);
      result.init();
      return result;
  }
View Full Code Here

    return new JAXBObjectSG(pController, schemaSG, pElement, pContext);
  }
 
  public ObjectSG getObjectSG(SGFactory pController, XSElement pElement, Context pContext) throws SAXException {
    ObjectSGChain chain = (ObjectSGChain) pController.newObjectSG(pElement, pContext);
    ObjectSG result = new ObjectSGImpl(chain);
    result.init();
    return result;
  }
View Full Code Here

  private void generateSubclasses(JavaSource pJs) throws SAXException {
    for (int i = 0;  i < particles.length;  i++) {
      ParticleSG particle = particles[i];
      if (particle.isElement()) {
        ObjectSG elementSG = particle.getObjectSG();
        TypeSG typeSG = elementSG.getTypeSG();
        if (!typeSG.isGlobalType()  &&  !typeSG.isGlobalClass()  &&  typeSG.isComplex()) {
          ComplexTypeSG complexTypeSG = typeSG.getComplexTypeSG();
          if (pJs.isInterface()) {
            complexTypeSG.getXMLInterface(pJs);
          } else {
View Full Code Here

    return names;
  }

  private void marshalElementParticle(JavaMethod pMethod, Object pValue,
                    ParticleSG pParticle) throws SAXException {
    ObjectSG oSG = pParticle.getObjectSG();
    if (oSG.getTypeSG().isComplex()) {
      Context cc = oSG.getTypeSG().getComplexTypeSG().getClassContext();
      JavaQName serializerClass = cc.getXMLSerializerName();
      LocalJavaField driver = pMethod.newJavaField(JMSAXDriver.class);
      if (oSG.getTypeSG().isGlobalClass()) {
        JavaQName elementInterface;
        if (oSG.isGlobal()) {
          elementInterface = oSG.getClassContext().getXMLInterfaceName();
        } else {
          elementInterface = cc.getXMLInterfaceName();
        }
        driver.addLine(getParamController(),
                 ".getJMMarshaller().getJAXBContextImpl().getManagerS(",
                 elementInterface, ".class).getDriver()");
      } else {
        driver.addLine("new ", serializerClass, "();");
      }
      pMethod.addLine(getParamController(), ".marshal(", driver,
              ", ", JavaSource.getQuoted(oSG.getName().getNamespaceURI()),
              ", ", JavaSource.getQuoted(oSG.getName().getLocalName()),
              ", ", pValue, ");");
    } else {
      Object value = oSG.getTypeSG().getSimpleTypeSG().getCastToString(pMethod, pValue, getParamController());
      pMethod.addLine(getParamController(), ".marshalSimpleChild(this, ",
              JavaSource.getQuoted(oSG.getName().getNamespaceURI()), ", ",
              JavaSource.getQuoted(oSG.getName().getLocalName()), ", ",
              value, ");");
    }
  }
View Full Code Here

      if (childs != null) {
        for (int i = 0;  i < childs.length;  i++) {
          ParticleSG child = childs[i];
          // Accept only simple elements
          if (child.isElement()) {
            ObjectSG objectSG = child.getObjectSG();
            if (!objectSG.getTypeSG().isComplex()) {
              allChilds.add(child);
            }
          }
        }
      }
View Full Code Here

        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

  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

    for (Iterator iter = pContextList.iterator();  iter.hasNext()) {
      Object o = iter.next();
      Context ctx, typeCtx;
      if (o instanceof ObjectSG) {
      ObjectSG oSG = (ObjectSG) o;
      ctx = oSG.getClassContext();
      typeCtx = oSG.getTypeSG().getComplexTypeSG().getClassContext();
      } else {
      TypeSG tSG = (TypeSG) o;
      ctx = typeCtx = tSG.getComplexTypeSG().getClassContext();
      }
View Full Code Here

    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, null, 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

TOP

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

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.