Package org.apache.ws.jaxme.js

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


  }

  protected JavaMethod getPMClassDeleteMethod(TypeSG pController, JavaSource pSource, CustomTableData pData)
      throws SAXException {
    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);
View Full Code Here


  }

  protected JavaMethod getPMClassSelectMethod(TypeSG pController, JavaSource pSource, CustomTableData pData)
      throws SAXException {
    JavaMethod jm = pSource.newJavaMethod("select", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    Parameter pObserver = jm.addParam(Observer.class, "pObserver");
    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();
View Full Code Here

    if (placeHolder == null) {
      throw new IllegalStateException("No such placeholder: 'GroupSG' in method 'startElement'");
    }
    placeHolder.remove();
    Parameter[] parameters = jm.getParams();
    Parameter pNamespaceURI = parameters[0];
    Parameter pLocalName = parameters[1];
    Parameter pQName = parameters[2];
    Parameter pAttr = parameters[3];

    jm.addCase("1");
    Set namespaces = new HashSet();
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG child = myParticles[i];
View Full Code Here

                 JAXBContext.class, ".newInstance(",
                 JavaSource.getQuoted(pPackageName), ");");

    JavaMethod newInstanceMethod = js.newJavaMethod("newInstance", Object.class, "public");
    newInstanceMethod.addThrows(JAXBException.class);
    Parameter pElementInterface = newInstanceMethod.addParam(Class.class, "pElementInterface");
    newInstanceMethod.addLine("return ", jf, ".getElement(", pElementInterface, ");");

    {
      JavaMethod getPropertyMethod = js.newJavaMethod("getProperty", Object.class, "public");
      Parameter pName = getPropertyMethod.addParam(String.class, "pName");
      getPropertyMethod.addIf(properties, " == null");
      getPropertyMethod.addLine("return null;");
      getPropertyMethod.addEndIf();
      getPropertyMethod.addLine("return ", properties, ".get(", pName, ");");
    }

    {
      JavaMethod setPropertyMethod = js.newJavaMethod("setProperty", void.class, "public");
      Parameter pName = setPropertyMethod.addParam(String.class, "pName");
      Parameter pValue = setPropertyMethod.addParam(Object.class, "pValue");
      setPropertyMethod.addIf(properties, " == null");
      setPropertyMethod.addLine(properties, " = new ", HashMap.class, "();");
      setPropertyMethod.addEndIf();
      setPropertyMethod.addLine(properties, ".put(", pName, ", ", pValue, ");");
    }
View Full Code Here

               jm.addParam(parameters[i]);
            }
            List callParameters = new ArrayList();
            callParameters.add("pController");
            for (int i = 0;  i < parameters.length;  i++) {
               Parameter parameter = parameters[i];
                     callParameters.add(", ");
                  callParameters.add(parameter.getName());
               }
            jm.addLine((void.class.equals(pMethod.getReturnType()) ? "" : " return "),
                       "backingObject.",
                       pMethod.getName(), "(", callParameters, ");");
            return jm;
         }
         public JavaSource generate(JavaSourceFactory pImplementationFactory,
                                     JavaQName pTargetClass,
                                     ProxyGenerator.InterfaceDescription[] pDescription) {
            JavaSource result = super.generate(pImplementationFactory, pTargetClass, pDescription);
            result.clearImplements();
            result.addImplements(getChainInterface());
            return result;
         }
      };
      JavaSource proxyImplementation = proxyImplementationGenerator.generate(pFactory, getProxyClass(), interfaces);

      ProxyGenerator controllerImplementationGenerator = new ProxyGenerator(){
         protected JavaField getBackingObjectField(JavaSource pJs, InterfaceDescription[] pInterfaces) {
            return pJs.newJavaField("backingObject", getChainInterface(), JavaSource.PRIVATE);
         }
         protected JavaConstructor getConstructor(JavaSource pJs,
                                                   InterfaceDescription[] pInterfaces) {
            JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PUBLIC);
            jcon.addParam(getChainInterface(), "o");
            jcon.addIf("o == null");
            jcon.addThrowNew(NullPointerException.class,
                             JavaSource.getQuoted("The supplied object must not be null."));
            jcon.addEndIf();
            jcon.addLine("backingObject = o;");
            return jcon;
         }
         public JavaMethod getInterfaceMethod(JavaSource pSource,
                                               ProxyGenerator.InterfaceDescription pDescription,
                                               java.lang.reflect.Method pMethod) {
            JavaMethod jm = pSource.newJavaMethod(pMethod);
            Parameter[] parameters = jm.getParams();
            List callParameters = new ArrayList();
            callParameters.add("this");
            for (int i = 0;  i < parameters.length;  i++) {
               Parameter parameter = parameters[i];
                     callParameters.add(", ");
                  callParameters.add(parameter.getName());
               }
            jm.addLine((void.class.equals(pMethod.getReturnType()) ? "" : " return "),
                       "backingObject.",
                       pMethod.getName(), "(", callParameters, ");");
            return jm;
View Full Code Here

                                            Method pMethod) {
     JavaMethod jm = pJs.newJavaMethod(pMethod);
      Parameter[] parameters = jm.getParams();
    List callParameters = new ArrayList();
      for (int i = 0;  i < parameters.length;  i++) {
      Parameter parameter = parameters[i];
        if (callParameters.size() > 0) {
          callParameters.add(", ");
        }
        callParameters.add(parameter.getName());
      }
    jm.addLine((void.class.equals(pMethod.getReturnType()) ? "" : " return "),
            "((", pInterfaceDescription.getInterface(), ") backingObject).",
            pMethod.getName(), "(", callParameters, ");");
    return jm;
View Full Code Here

  }

  protected JavaMethod getPMClassInsertMethod(TypeSG pController, JavaSource pSource, CustomTableData pData)
      throws SAXException {
    JavaMethod jm = pSource.newJavaMethod("insert", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    Parameter pElement = jm.addParam(Element.class, "pElement");
    jm.addThrows(PMException.class);
    Table table = pData.getTable();

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

  }

  protected JavaMethod getPMClassUpdateMethod(TypeSG pController, JavaSource pSource, CustomTableData pData)
      throws SAXException {
    JavaMethod jm = pSource.newJavaMethod("update", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    Parameter pElement = jm.addParam(Element.class, "pElement");
    jm.addThrows(PMException.class);
    Table table = pData.getTable();

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

  }

  protected JavaMethod getPMClassDeleteMethod(TypeSG pController, JavaSource pSource, CustomTableData pData)
      throws SAXException {
    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);
View Full Code Here

  }

  protected JavaMethod getPMClassSelectMethod(TypeSG pController, JavaSource pSource, CustomTableData pData)
      throws SAXException {
    JavaMethod jm = pSource.newJavaMethod("select", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    Parameter pObserver = jm.addParam(Observer.class, "pObserver");
    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();
View Full Code Here

TOP

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

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.