Package org.apache.ws.jaxme.js

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


      entry.addLine("(", Map.Entry.class, ") ", iter, ".next()");
      if (!pSource.isInterface()) {
        jm.addLine(result, "[--", size, "] = new ", WildcardAttribute.class, "((",
                   QName.class, ") ", entry, ".getKey(), (", String.class, ") ",
             entry, ".getValue());");
        jm.addEndFor();
        jm.addLine("return ", result, ";");
      }
      return jm;
  }
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

          "), ", 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

          "), ", 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

      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

      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

      jm.addElse();
      jm.addIf("!", v, ".equals(", other, ".values[", loopVar, "])");
      jm.addLine("return false;");
      jm.addEndIf();
      jm.addEndIf();
      jm.addEndFor();
      jm.addLine("return true;");
    }
   
    return jic;
  }
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.