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

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



    Set packages = new HashSet();
    for (Iterator iter = contextList.iterator();  iter.hasNext()) {
      Object o = iter.next();
      Context ctx;
      if (o instanceof ObjectSG) {
        ctx = ((ObjectSG) o).getClassContext();
      } else {
        ctx = ((TypeSG) o).getComplexTypeSG().getClassContext();
      }
      String packageName = ctx.getXMLInterfaceName().getPackageName();
      if (packages.contains(packageName)) {
        continue;
      }

      TextFile textFile = pController.getJavaSourceFactory().newTextFile(packageName, "jaxb.properties");
View Full Code Here


        manager.addLine("getHandler().getJMUnmarshaller().getJAXBContextImpl().getManagerS(",
            elementInterfaceClass, ".class)");
        o = new Object[]{manager, ".getElementS();"};
        h = new Object[]{manager, ".getHandler();"};
      } else {
        Context context = oSG.getClassContext();
        o = new Object[]{" new ", context.getXMLImplementationName(), "()"};
        h = new Object[]{" new ", context.getXMLHandlerName(), "()"};
      }
      LocalJavaField oField = pJm.newJavaField(Object.class);
      oField.addLine(o);
      LocalJavaField hField = pJm.newJavaField(JMSAXElementParser.class);
      hField.addLine(h);
View Full Code Here

      isClassGlobal = !type.isSimple()  &&  (type.isGlobal()  ||  global);
    } else {
      throw new IllegalStateException("Unknown object type: " + pObject.getClass().getName());
    }

    Context myClassContext;
    final boolean useTypesContext = pClassContext != null;
    if (useTypesContext) {
      myClassContext = pClassContext;
    } else {
      myClassContext = new GlobalContext(name, pObject, null, null, pSchema);
    }

    if (isClassGlobal) {
      if (type.isGlobal()) {
        typeSG = pFactory.getTypeSG(type);
      } else {
        typeSG = pFactory.getTypeSG(type, name);
      }
    } else {
      typeSG = pFactory.getTypeSG(type, myClassContext, name);
    }

    if (useTypesContext) {
      if (typeSG.isComplex()) {
        classContext = typeSG.getComplexTypeSG().getClassContext();
      } else {
        classContext = pClassContext;
      }
    } else if (typeSG.isComplex()) {
      classContext = myClassContext;
      Context tctx = typeSG.getComplexTypeSG().getClassContext();
      AbstractContext ctx = (AbstractContext) classContext;
      ctx.setPMName(tctx.getPMName());
      ctx.setXMLSerializerName(tctx.getXMLSerializerName());
      ctx.setXMLValidatorName(tctx.getXMLValidatorName());
    } else {
      classContext = null;
    }
    log.finest(mName, "<-", new Object[]{typeSG, classContext});
  }
View Full Code Here

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

    root.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns", uri);
    doc.appendChild(root);

    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();
      }

      String packageName = ctx.getXMLInterfaceName().getPackageName();
      if (packageName == null) {
        packageName = "";
      }
      if (!packageName.equals(pPackageName)) {
        continue;
      }

      Element manager = doc.createElementNS(uri, "Manager");
      root.appendChild(manager);
      manager.setAttributeNS(null, "elementInterface", ctx.getXMLInterfaceName().toString());
      manager.setAttributeNS(null, "elementClass", ctx.getXMLImplementationName().toString());
      manager.setAttributeNS(null, "handlerClass", typeCtx.getXMLHandlerName().toString());
      manager.setAttributeNS(null, "driverClass", typeCtx.getXMLSerializerName().toString());
      manager.setAttributeNS(null, "validatorClass", ctx.getXMLValidatorName().toString());
      if (o instanceof ObjectSG) {
      XsQName name = ((ObjectSG) o).getName();
      manager.setAttributeNS(null, "qName", name.toString());
      if (name.getPrefix() != null) {
        manager.setAttributeNS(null, "prefix", name.getPrefix());
View Full Code Here


    Set packages = new HashSet();
    for (Iterator iter = contextList.iterator();  iter.hasNext()) {
      Object o = iter.next();
      Context ctx;
      if (o instanceof ObjectSG) {
        ctx = ((ObjectSG) o).getClassContext();
      } else {
        ctx = ((TypeSG) o).getComplexTypeSG().getClassContext();
      }
      String packageName = ctx.getXMLInterfaceName().getPackageName();
      if (packages.contains(packageName)) {
        continue;
      }

      TextFile textFile = pController.getJavaSourceFactory().newTextFile(packageName, "jaxb.properties");
View Full Code Here

        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();
      JavaField jf = pSource.newJavaField(serializerName, serializerClass, JavaSource.PRIVATE);
      JavaQName elementInterface = myClassContext.getXMLInterfaceName();
      if (child.getTypeSG().isGlobalClass()) {
        jm.addLine(jf, " = (", serializerClass, ") ", pFactory, ".getJMXmlSerializer(", elementInterface, ".class);");
      } else {
        jm.addLine(jf, " = new ", serializerClass, "();");
      }
View Full Code Here

    root.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns", uri);
    doc.appendChild(root);

    for (Iterator iter = pContextList.iterator();  iter.hasNext()) {
      Object o = iter.next();
      Context ctx;
      if (o instanceof ObjectSG) {
        ctx = ((ObjectSG) o).getClassContext();
      } else {
        ctx = ((TypeSG) o).getComplexTypeSG().getClassContext();
      }

      String packageName = ctx.getXMLInterfaceName().getPackageName();
      if (packageName == null) {
        packageName = "";
      }
      if (!packageName.equals(pPackageName)) {
        continue;
      }

      Element manager = doc.createElementNS(uri, "Manager");
      root.appendChild(manager);
      manager.setAttributeNS(null, "elementInterface", ctx.getXMLInterfaceName().toString());
      manager.setAttributeNS(null, "elementClass", ctx.getXMLImplementationName().toString());
      manager.setAttributeNS(null, "handlerClass", ctx.getXMLHandlerName().toString());
      manager.setAttributeNS(null, "marshallerClass", ctx.getXMLSerializerName().toString());
      manager.setAttributeNS(null, "validatorClass", ctx.getXMLValidatorName().toString());
      if (o instanceof ObjectSG) {
        manager.setAttributeNS(null, "qName", ((ObjectSG) o).getName().toString());
      }
    }
    return doc;
View Full Code Here


    Map packages = new HashMap();
    for (Iterator iter = contextList.iterator();  iter.hasNext()) {
      Object o = iter.next();
      Context ctx;
      if (o instanceof ObjectSG) {
        ctx = ((ObjectSG) o).getClassContext();
      } else {
        ctx = ((TypeSG) o).getComplexTypeSG().getClassContext();
      }
      String packageName = ctx.getXMLInterfaceName().getPackageName();
      if (packages.containsKey(packageName)) {
        continue;
      }

      TextFile textFile = pController.getJavaSourceFactory().newTextFile(packageName, "jaxb.properties");
View Full Code Here

      isClassGlobal = !type.isSimple()  &&  (type.isGlobal()  ||  element.isGlobal());
    } else {
      throw new IllegalStateException("Unknown object type: " + pObject.getClass().getName());
    }

    Context myClassContext;
    final boolean useTypesContext = pClassContext != null;
    if (useTypesContext) {
      myClassContext = pClassContext;
    } else {
      myClassContext = new GlobalContext(name, pObject, null, null, pSchema);
    }

    if (isClassGlobal) {
      if (type.isGlobal()) {
        typeSG = pFactory.getTypeSG(type);
      } else {
        typeSG = pFactory.getTypeSG(type, name);
      }
    } else {
      typeSG = pFactory.getTypeSG(type, myClassContext, name);
    }

    if (useTypesContext) {
      if (typeSG.isComplex()) {
        classContext = typeSG.getComplexTypeSG().getClassContext();
      } else {
        classContext = pClassContext;
      }
    } else if (typeSG.isComplex()) {
      classContext = myClassContext;
      Context tctx = typeSG.getComplexTypeSG().getClassContext();
      AbstractContext ctx = (AbstractContext) classContext;
      ctx.setPMName(tctx.getPMName());
      ctx.setXMLSerializerName(tctx.getXMLSerializerName());
      ctx.setXMLValidatorName(tctx.getXMLValidatorName());
    } else {
      classContext = null;
    }
    log.finest(mName, "<-", new Object[]{typeSG, classContext});
  }
View Full Code Here

TOP

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

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.