Package org.apache.ws.jaxme.js

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


    JavaMethod jm = pSource.newJavaMethod("delete", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    Parameter pElement = jm.addParam(Element.class, "pElement");
    jm.addThrows(PMException.class);
    Table table = pData.getTable();

    JavaQName qName = pController.getComplexTypeSG().getClassContext().getXMLInterfaceName();
    LocalJavaField elem = jm.newJavaField(qName);
    elem.addLine("(", qName, ") ", pElement);

    String q = table.getSchema().getSQLFactory().newSQLGenerator().getQuery(table.getDeleteStatement());   
    LocalJavaField query = jm.newJavaField(String.class);
View Full Code Here


    Parameter pQuery = jm.addParam(String.class, "pQuery");
    Parameter pParams = jm.addParam(PMParams.class, "pParams");
    jm.addThrows(PMException.class);
    Table table = pData.getTable();

    JavaQName qName = pController.getComplexTypeSG().getClassContext().getXMLInterfaceName();
    StringBuffer sb = new StringBuffer();
    for (Iterator iter = table.getColumns();  iter.hasNext()) {
      Column col = (Column) iter.next();
      if (sb.length() > 0) sb.append(", ");
      sb.append(col.getName().getName());
View Full Code Here

    jm.addSwitch("--", pLevelVar);
    jm.addCase("0");
    jm.addBreak();
    jm.addCase("1");
    JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
    LocalJavaField element = jm.newJavaField(elementInterface);
    element.addLine("(", elementInterface, ") getResult()");
    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;
      JavaQName type;
      if (childType.isComplex()) {
        type = childType.getComplexTypeSG().getClassContext().getXMLInterfaceName();
        v = new Object[]{pHandlerVar, ".getResult()"};
      } else {
        type = null;
View Full Code Here

      f.addLine("new ", QName.class, "(", JavaSource.getQuoted(objectSG.getName().getNamespaceURI()),
                ", ", JavaSource.getQuoted(objectSG.getName().getLocalName()), ");");
      if (objectSG.getTypeSG().isComplex()) {
          Context myClassContext =
              child.getObjectSG().getTypeSG().getComplexTypeSG().getClassContext();
          JavaQName serializerClass = myClassContext.getXMLSerializerName();
          pMethod.addIf(fieldName + " == null");
          pMethod.addTry();
          if (child.getObjectSG().getTypeSG().isGlobalClass()) {
              JavaQName elementInterface;
              if (objectSG.isGlobal()) {
                elementInterface = objectSG.getClassContext().getXMLInterfaceName();
              } else {
                elementInterface = myClassContext.getXMLInterfaceName();
              }
View Full Code Here

      if (prefix == null) { prefix = pPrefix; }
      if (prefix != null) className = prefix + className;
      if (suffix == null) { suffix = pSuffix; }
      if (suffix != null) className += suffix;
    }
    JavaQName xmlInterfaceName = JavaQNameImpl.getInnerInstance(pContext.getXMLInterfaceName(), className);
    setXMLInterfaceName(xmlInterfaceName);

    if (implementationName == null) {
      setXMLImplementationName(JavaQNameImpl.getInnerInstance(pContext.getXMLImplementationName(),
                                                              className + "Impl"));
    } else {
      setXMLImplementationName(JavaQNameImpl.getInstance(implementationName, true));
    }
    setXMLHandlerName(JavaQNameImpl.getInnerInstance(pContext.getXMLHandlerName(), className + "Handler"));
    setXMLSerializerName(JavaQNameImpl.getInnerInstance(pContext.getXMLSerializerName(), className + "Serializer"));
    setXMLValidatorName(JavaQNameImpl.getInstance(xmlInterfaceName.getPackageName() + ".impl",
                                                  xmlInterfaceName.getClassName() + "Validator"));
    setPMName(JavaQNameImpl.getInstance(xmlInterfaceName.getPackageName() + ".impl",
                                        xmlInterfaceName.getClassName() + "PM"));
  }
View Full Code Here

      getObjectFactory(pController, packageName, contextList);
    }
  }

  protected JavaSource getObjectFactory(SchemaSG pController, String pPackageName, List pContextList) {
    JavaQName qName = JavaQNameImpl.getInstance(pPackageName, "ObjectFactory");
    JavaSource js = pController.getJavaSourceFactory().newJavaSource(qName, "public");
    JavaField jf = js.newJavaField("jaxbContext", JAXBContextImpl.class, "private");
    JavaField properties = js.newJavaField("properties", Map.class, "private");

    JavaConstructor jcon = js.newJavaConstructor("public");
View Full Code Here

   * Generic util method for generating the create<NAME> methods for the object factory.
   * @param pSource the java source object to add the method
   * @param pContext the Class Context from either an ObjectSG or a TypeSG
   */
  private void generateCreateMethod(JavaSource pSource, Context pContext) {
    JavaQName resultName = pContext.getXMLInterfaceName();
    String className = resultName.getClassName();
    String methodName = "create" + Character.toUpperCase(className.charAt(0)) + className.substring(1);
    JavaMethod createMethod = pSource.newJavaMethod(methodName, resultName, "public");
    createMethod.addThrows(JAXBException.class);
    createMethod.addLine("return (", resultName, ") newInstance(", resultName, ".class);");
  }
View Full Code Here

      JavaSource js = pMethod.getJavaSource();
      while (js.isInnerClass()) {
        js = ((JavaInnerClass) js).getOuterClass();
      }
      JavaField[] fields = js.getFields();
      JavaQName qName = JavaQNameImpl.getInstance(DatatypeConverterInterface.class);
      JavaField converter = null;
      for (int i = 0;  i < fields.length;  i++) {
        if (qName.equals(fields[i].getType())  &&  JavaSource.DEFAULT_PROTECTION.equals(fields[i].getProtection())  &&
            fields[i].isStatic()  &&  fields[i].isFinal()) {
          converter = fields[i];
          break;
        }
      }
View Full Code Here

      value = v;
    }

    LocalJavaField result = pMethod.newJavaField(String.class);
    for (int i = 0;  i < memberTypes.length;  i++) {
      JavaQName memberRuntimeType = memberTypes[i].getSimpleTypeSG().getRuntimeType();
      pMethod.addIf(i == 0, value, " instanceof ", memberRuntimeType);
      Object v = OBJECT_TYPE.equals(memberRuntimeType) ?
        (Object) value :
        new Object[]{"((", memberRuntimeType, ") ", value, ")"};
      pMethod.addLine(result, " = ", memberTypes[i].getSimpleTypeSG().getCastToString(pMethod, v, pData), ";");
View Full Code Here

    Object result = new Object[]{"new ", itemType.getSimpleTypeSG().getRuntimeType(), "[]{", list, "}"};
    String collectionType = pController.getCollectionType();
    if ("indexed".equals(collectionType)) {
      return result;
    } else {
      JavaQName myListType = JavaQNameImpl.getInstance(collectionType, true);
      return new Object[]{"(new ", myListType, "(", Arrays.class, ".asList(", result, ")))"};
    }
  }
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.