Examples of newJavaMethod()


Examples of org.apache.ws.jaxme.js.JavaInnerClass.newJavaMethod()

        JavaComment comment = invoker.newComment();
        comment.addLine("The dispatcher is implemented with a {@link java.util.Map}.");
        comment.addLine("The map keys are the method names, the values");
        comment.addLine("are instances of <code>Invoker</code>.");
        invoker.setType(JavaSource.INTERFACE);
        JavaMethod jm = invoker.newJavaMethod("invoke", Object.class, JavaSource.PUBLIC);
        comment = jm.newComment();
        comment.addLine("This method creates a new instance of the class being");
        comment.addLine("called, converts the parameter objects (if required)");
        comment.addLine("and invokes the requested method. If required, the");
        comment.addLine("result is converted also and returned.");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaInnerClass.newJavaMethod()

        JavaComment comment = js.newComment();
        comment.addLine("Invoker for method " + pMethod.getName() + "(" + sb + ")");
        comment.addLine("in class " + pMethod.getJavaSource().getQName() + ".");
        js.setStatic(true);
        js.addImplements(pInvoker);
        JavaMethod jm = js.newJavaMethod("invoke", Object.class, JavaSource.PUBLIC);
        Parameter param = jm.addParam(Vector.class, "params");
        JavaQName[] classes = pMethod.getExceptions();
        for (int i = 0;  i < classes.length;  i++) {
          jm.addThrows(classes[i]);
        }
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaInnerClass.newJavaMethod()

     DirectAccessible pName = jcon.addParam(String.class, "pName");
     DirectAccessible pValues = jcon.addParam(Object[].class, "pValues");
     jcon.addLine(name, " = ", pName, ";");
     jcon.addLine(values, " = ", pValues, ";");

     JavaMethod getNameMethod = jic.newJavaMethod("getName", String.class, JavaSource.PUBLIC);
     getNameMethod.addLine("return ", name, ";");

     JavaMethod getValuesMethod = jic.newJavaMethod("getValues", Object[].class, JavaSource.PUBLIC);
     getValuesMethod.addLine("return ", values, ";");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaInnerClass.newJavaMethod()

     jcon.addLine(values, " = ", pValues, ";");

     JavaMethod getNameMethod = jic.newJavaMethod("getName", String.class, JavaSource.PUBLIC);
     getNameMethod.addLine("return ", name, ";");

     JavaMethod getValuesMethod = jic.newJavaMethod("getValues", Object[].class, JavaSource.PUBLIC);
     getValuesMethod.addLine("return ", values, ";");

     {
       JavaMethod jm = jic.newJavaMethod("toString", String.class, JavaSource.PUBLIC);
       LocalJavaField sb = jm.newJavaField(StringBuffer.class, "sb");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaInnerClass.newJavaMethod()

     JavaMethod getValuesMethod = jic.newJavaMethod("getValues", Object[].class, JavaSource.PUBLIC);
     getValuesMethod.addLine("return ", values, ";");

     {
       JavaMethod jm = jic.newJavaMethod("toString", String.class, JavaSource.PUBLIC);
       LocalJavaField sb = jm.newJavaField(StringBuffer.class, "sb");
       sb.addLine("new ", StringBuffer.class, "(", name, ")");
       DirectAccessible loopVar = jm.addForArray(values);
       jm.addLine(sb, ".append(", JavaSource.getQuoted(", "), ").append(",
                  values, "[", loopVar, "]);");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaInnerClass.newJavaMethod()

       jm.addLine("return ", sb, ".toString();");

     }

     {
       JavaMethod jm = jic.newJavaMethod("hashCode", int.class, JavaSource.PUBLIC);
       LocalJavaField hashCodeResult = jm.newJavaField(int.class, "result");
       hashCodeResult.addLine(name, ".hashCode() + ", values, ".length;");
       DirectAccessible loopVar = jm.addForArray(values);
       LocalJavaField o = jm.newJavaField(Object.class, "o");
       o.addLine(values, "[", loopVar, "]");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaInnerClass.newJavaMethod()

       jm.addEndFor();
       jm.addLine("return ", hashCodeResult, ";");
     }

     {
       JavaMethod jm = jic.newJavaMethod("equals", boolean.class, JavaSource.PUBLIC);
       DirectAccessible o = jm.addParam(Object.class, "o");
       jm.addIf(o, " == null  ||  !(", o, " instanceof ", jic.getQName(), ")");
       jm.addLine("return false;");
       jm.addEndIf();
       LocalJavaField other = jm.newJavaField(jic.getQName(), "other");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaSource.newJavaMethod()

    jcon.addThrows(JAXBException.class);
    jcon.addLine(jf, " = (", JAXBContextImpl.class, ") ",
                 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, ");");

    {
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaSource.newJavaMethod()

    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, ");");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaSource.newJavaMethod()

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