Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.JavaMethod.addParam()


        jc.addLine("references.");
      }
    }
                
    DirectAccessible conn = jm.addParam(Connection.class, "pConn");
    DirectAccessible row = jm.addParam(resultType, "pRow");

    logEntering(jm, new Object[]{"new ", Object[].class, "{", conn, ", ", row, "}"});

    LocalJavaField map = jm.newJavaField(Map.class, "clonedObjects");
    map.addLine("new ", HashMap.class, "()");
View Full Code Here


   private JavaSource getPlaceHolderSource(boolean pAutoMode) {
     JavaSourceFactory factory = new JavaSourceFactory();
     JavaSource js = factory.newJavaSource(JavaQNameImpl.getInstance("com.foo", "Bar"), JavaSource.PUBLIC);
     JavaMethod main = js.newJavaMethod("main", JavaQNameImpl.VOID, JavaSource.PUBLIC);
     main.addParam(String[].class, "pArgs");
     main.setStatic(true);
     main.addThrows(Exception.class);
     main.addFor(int.class, " i = 1;  i < 10;  i++");
     main.newPlaceHolder("test", pAutoMode);
     main.addEndFor();
View Full Code Here

    getMethod.addLine("return this.", propertyName, ";");   
  }
 
  protected void addSetter(String propertyName, String methodName, JavaQName propertyType) {
    JavaMethod setMethod = source.newJavaMethod(methodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
    setMethod.addParam(propertyType, propertyName);
    setMethod.addLine("this.", propertyName, " = ", propertyName, ";");
  }
 
  protected void addAdder(String propertyName, String methodName, JavaQName arrayType) {
    JavaMethod addMethod = source.newJavaMethod(methodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
View Full Code Here

    setMethod.addLine("this.", propertyName, " = ", propertyName, ";");
  }
 
  protected void addAdder(String propertyName, String methodName, JavaQName arrayType) {
    JavaMethod addMethod = source.newJavaMethod(methodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
    addMethod.addParam(arrayType, propertyName);
    if(!options.isListAsPlainArray()) {
      addMethod.addLine("if(this."+propertyName+"==null) this."+propertyName
        +" = new "+JavaQNameImpl.getInstance(options.getListImplementation())+"();");
      addMethod.addLine("this.", propertyName, ".add(", propertyName, ");");
    } else {
View Full Code Here

    }
  }
 
  protected void addItemer(String propertyName, String methodName, JavaQName arrayType) {
    JavaMethod itemMethod = source.newJavaMethod(methodName, arrayType, JavaSource.PUBLIC);
    itemMethod.addParam(JavaQNameImpl.INT, "num");
    if(options.isListAsPlainArray()) {
      itemMethod.addLine("return this."+propertyName+"[num];");
    } else {
      itemMethod.addLine("return ("+arrayType.getClassName()+")this."+propertyName+".get(num);");
    }
View Full Code Here

    }
  }
 
  protected void addRemover(String propertyName, String methodName, JavaQName arrayType) {
    JavaMethod itemMethod = source.newJavaMethod(methodName, arrayType, JavaSource.PUBLIC);
    itemMethod.addParam(JavaQNameImpl.INT, "num");
    if(options.isListAsPlainArray()) {
      throw new IllegalStateException("remove method arent supported with plain arrays");
    } else {
      itemMethod.addLine("return ("+arrayType.getClassName()+")this."+propertyName+".remove(num);");
    }
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();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.