Package org.apache.ws.jaxme.js

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


          "), ", pAttr, ".getValue(", iVar, "));");
    } else {
      jm.addLine("addAttribute(", pAttr, ".getURI(", iVar, "), ", pAttr, ".getLocalName(", iVar,
          "), ", pAttr, ".getValue(", iVar, "));");     
    }
    jm.addEndFor();
    jm.addEndIf();
    if (pController.hasSimpleContent()) {
        JavaField jf = pSource.newJavaField("__content", StringBuffer.class, JavaSource.PRIVATE);
        jm.addLine(jf, " = new ", StringBuffer.class, "();");
    }
View Full Code Here


        LocalJavaField localPart = jm.newJavaField(String.class);
        localPart.addLine(qName, ".getLocalPart()");
        jm.addLine(result, ".addAttribute(", uri, ", ", localPart,
               ", getAttributeQName(pData, ", uri, ", ", localPart,
                           "), \"CDATA\", ", wildcardAttribute, ".getValue());");
        jm.addEndFor();
      } else {
        sgLet.setAttribute(attribute);
        attribute.forAllNonNullValues(jm, element, sgLet);
      }
    }
View Full Code Here

    fromValueMethod.setStatic(true);
    DirectAccessible i = fromValueMethod.addForArray(instances);
    fromValueMethod.addIf(pController.getEqualsCheck(fromValueMethod, new Object[]{instances, "[", i, "].value"}, pValue));
    fromValueMethod.addLine("return ", instances, "[", i, "];");
    fromValueMethod.addEndIf();
    fromValueMethod.addEndFor();
    fromValueMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid value: "),
                                " + ", pValue);

    JavaMethod fromNameMethod = js.newJavaMethod("fromName", qName, JavaSource.PUBLIC);
    pName = fromNameMethod.addParam(String.class, "pName");
View Full Code Here

    fromNameMethod.setStatic(true);
    i = fromNameMethod.addForArray(instances);
    fromNameMethod.addIf(instances, "[", i, "].name.equals(", pName, ")");
    fromNameMethod.addLine("return ", instances, "[", i, "];");
    fromNameMethod.addEndIf();
    fromNameMethod.addEndFor();
    fromNameMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid name: "),
                                " + ", pName);

    JavaMethod fromStringMethod = js.newJavaMethod("fromString", qName, JavaSource.PUBLIC);
    pValue = fromStringMethod.addParam(String.class, "pValue");
View Full Code Here

      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, "]);");
      jm.addEndFor();
      jm.addLine("return ", sb, ".toString();");
     
    }
   
    {
View Full Code Here

     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();
     js.setDynamicImports(true);
     return js;
   }

   public void testPlaceHolders() {
View Full Code Here

    fromValueMethod.setStatic(true);
    DirectAccessible i = fromValueMethod.addForArray(instances);
    fromValueMethod.addIf(pController.getEqualsCheck(fromValueMethod, new Object[]{instances, "[", i, "].value"}, pValue));
    fromValueMethod.addLine("return ", instances, "[", i, "];");
    fromValueMethod.addEndIf();
    fromValueMethod.addEndFor();
    fromValueMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid value: "),
                                " + ", pValue);

    JavaMethod fromNameMethod = js.newJavaMethod("fromName", qName, JavaSource.PUBLIC);
    pName = fromNameMethod.addParam(String.class, "pName");
View Full Code Here

    fromNameMethod.setStatic(true);
    i = fromNameMethod.addForArray(instances);
    fromNameMethod.addIf(instances, "[", i, "].name.equals(", pName, ")");
    fromNameMethod.addLine("return ", instances, "[", i, "];");
    fromNameMethod.addEndIf();
    fromNameMethod.addEndFor();
    fromNameMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid name: "),
                                " + ", pName);

    JavaMethod fromStringMethod = js.newJavaMethod("fromString", qName, JavaSource.PUBLIC);
    pValue = fromStringMethod.addParam(String.class, "pValue");
View Full Code Here

          LocalJavaField localPart = jm.newJavaField(String.class);
          localPart.addLine(qName, ".getLocalPart()");
          jm.addLine(result, ".addAttribute(", uri, ", ", localPart,
                 ", ", pController, ".getAttrQName(this, ", uri, ", ", localPart,
                             "), \"CDATA\", ", wildcardAttribute, ".getValue());");
          jm.addEndFor();
        } else {
          SGlet sgLet = new SGlet(){
            public void generate(JavaMethod pMethod, Object pValue) throws SAXException {
              String uri = JavaSource.getQuoted(attribute.getName().getNamespaceURI());
              String localName = JavaSource.getQuoted(attribute.getName().getLocalName());
View Full Code Here

      LocalJavaField o = jm.newJavaField(Object.class, "o");
      o.addLine(values, "[", loopVar, "]");
      jm.addIf(o, " != null");
      jm.addLine(hashCodeResult, " += ", o, ".hashCode();");
      jm.addEndIf();
      jm.addEndFor();
      jm.addLine("return ", hashCodeResult, ";");
    }
   
    {
      JavaMethod jm = jic.newJavaMethod("equals", boolean.class, JavaSource.PUBLIC);
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.