Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.JavaQName


    pMethod.addLine(list, ".add(", itemType.getSimpleTypeSG().getCastFromString(pMethod, new Object[]{st, ".nextToken()"}, pData),
                    ");");
    pMethod.addEndFor();

    if ("indexed".equals(collectionType)) {
      JavaQName iType = itemType.getSimpleTypeSG().getRuntimeType();
      return new Object[]{"((", iType, ") ", list, ".toArray(new ", iType, "[", list, ".size()]))"};
    } else {
      return list;
    }
  }
View Full Code Here


    throw new IllegalStateException("Not implemented");
  }

  public Object getInitialValue(SimpleTypeSG pController, JavaSource p0) throws SAXException {
    String s = pController.getCollectionType();
    JavaQName listClass = "indexed".equals(s) ? ARRAYLIST_TYPE : JavaQNameImpl.getInstance(s, true);
    return new Object[]{"new ", listClass, "()"};
  }
View Full Code Here

  public JavaField getXMLField(PropertySG pController, JavaSource pSource) throws SAXException {
    if (pSource.isInterface()) {
      return null;
    }
    JavaQName runtimeType = JavaQNameImpl.getInstance(Map.class);
    JavaField jf = pSource.newJavaField(pController.getXMLFieldName(), runtimeType, JavaSource.PRIVATE);
    jf.setFinal(true);
    jf.addLine("new ", HashMap.class, "()");
    return jf;
  }
View Full Code Here

  public boolean isGlobal(GroupSG pController) { return isGlobal; }
  public boolean isChoice(GroupSG pController) { return isChoice; }
  public boolean isSequence(GroupSG pController) { return isSequence; }

  public JavaSource getXMLInterface(GroupSG pController) throws SAXException {
    JavaQName qName = pController.getClassContext().getXMLInterfaceName();
    JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(qName, JavaSource.PUBLIC);
    js.setType(JavaSource.INTERFACE);
    pController.generateProperties(js);
    return js;
View Full Code Here

    return js;
  }


  public JavaSource getXMLImplementation(GroupSG pController) throws SAXException {
    JavaQName qName = pController.getClassContext().getXMLImplementationName();
    JavaSourceFactory jsf = getSchema().getJavaSourceFactory();
    JavaSource js = jsf.newJavaSource(qName, JavaSource.PUBLIC);
    js.addImplements(pController.getClassContext().getXMLInterfaceName());
    SerializableSG.makeSerializable(pController.getSchema(), js);
    pController.generateProperties(js);
View Full Code Here

        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

      ParticleSG particle = myParticles[i];
      if (jm == null) {
        jm = pSource.newJavaMethod("marshalChilds", JavaQNameImpl.VOID, JavaSource.PROTECTED);
        DirectAccessible pData = jm.addParam(JavaQNameImpl.getInstance(JMXmlSerializer.Data.class), "pData");
        sgLet = new XMLSerializersMarshalChildsSGlet(pData);
        JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
        DirectAccessible pObject = jm.addParam(Object.class, "pObject");
        pElement = jm.newJavaField(elementInterface);
        pElement.addLine("(", elementInterface, ") ", pObject);
        jm.addThrows(SAXException.class);
      }
View Full Code Here

          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();
            }
View Full Code Here

      ParticleSG[] myParticles = pController.getParticles();
      if (myParticles.length == 0) {
          return;
      }
     
      JavaQName STRING_TYPE = JavaQNameImpl.getInstance(String.class);
      JavaQName ATTRIBUTES_TYPE = JavaQNameImpl.getInstance(Attributes.class);
      JavaMethod jm = pSource.getMethod("startElement", new JavaQName[]{STRING_TYPE,
                                                                      STRING_TYPE,
                                                                        STRING_TYPE,
                                      ATTRIBUTES_TYPE});
      if (jm == null) {
View Full Code Here

  public JavaField getXMLField(TypeSG pController, JavaSource pSource,
                                 String pFieldName, String pDefaultValue) throws SAXException {
    if (pSource.isInterface()) {
      return null;
    } else {
      JavaQName runtimeType;
      if (pController.isComplex() && pFieldName.equals("value") && pController.getComplexTypeSG().hasSimpleContent()) {
        SimpleContentSG obj = pController.getComplexTypeSG().getSimpleContentSG();
        runtimeType = obj.getContentTypeSG().getRuntimeType();
        if (pController.isRestriction()) {
          if (pController.getRestrictedType().isExtension()) {
            runtimeType = pController.getRestrictedType().getExtendedType().getRuntimeType();
          }
        }
      }
      else {
        runtimeType = pController.getRuntimeType();
      }
      JavaField jf = pSource.newJavaField(pFieldName, runtimeType, JavaSource.PRIVATE);
      if (!pController.isComplex()) {
        Object o = pController.getSimpleTypeSG().getInitialValue(pSource);
        if (o == null && pDefaultValue != null) {
          if (runtimeType.equals(StringSG.STRING_TYPE)) {
            o = "\"" + pDefaultValue + "\"";
          }
          else {
            o = pDefaultValue;
          }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.js.JavaQName

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.