Package org.apache.ws.jaxme.js

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


      boolean first = true;
      for (Iterator iter = uris.entrySet().iterator();  iter.hasNext()) {
        Map.Entry entry = (Map.Entry) iter.next();
        String uri = (String) entry.getKey();
        String prefix = (String) entry.getValue();
        jm.addIf(first, pURI, ".equals(", JavaSource.getQuoted(uri), ")");
        jm.addLine("return ", JavaSource.getQuoted(prefix), ";");     
        first = false;
      }
      jm.addEndIf();
    }
View Full Code Here


    JavaMethod jm = getJavaSource().newJavaMethod("addAttribute", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    DirectAccessible pURI = jm.addParam(String.class, "pURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pValue = jm.addParam(String.class, "pValue");
    jm.addThrows(SAXException.class);
    jm.addIf(pURI, " == null");
    jm.addLine(pURI, " = \"\";");
    jm.addEndIf();
   
    JavaQName resultType = ctSG.getClassContext().getXMLInterfaceName();
    LocalJavaField result = jm.newJavaField(resultType);
View Full Code Here

    Set uris = createSetOfExplicitURIs(myAttributes);
    boolean first = true;
    for (Iterator iter = uris.iterator();  iter.hasNext()) {
      String uri = (String) iter.next();
      jm.addIf(first, JavaSource.getQuoted(uri), ".equals(", pURI, ")");
      first = false;
      boolean firstInNamespace = true;
      for (int i = 0;  i < myAttributes.length;  i++) {
        AttributeSG attr = myAttributes[i];
        if (attr.isWildcard()) {
View Full Code Here

        if (jUri == null) { jUri = ""; }
        if (!uri.equals(jUri)) {
          continue;
        }
       
        jm.addIf(firstInNamespace, JavaSource.getQuoted(attr.getName().getLocalName()), ".equals(", pLocalName, ")");
        firstInNamespace = false;
        createSimpleTypeConversion(jm, myAttributes[i].getTypeSG(), pValue,
                       "@" + myAttributes[i].getName(),
                       attr.getPropertySG(), result);
        jm.addLine("return;");
View Full Code Here

    newInstanceMethod.addLine("return ", jf, ".getManager(", pElementInterface, ").getElementJ();");

    {
      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

    {
      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

    }
   
    {
      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");
      other.addLine("(", jic.getQName(), ") ", o);
      jm.addIf("!", name, ".equals(", other, ".name)  ||  ", values, ".length != ",
View Full Code Here

      jm.addIf(o, " == null  ||  !(", o, " instanceof ", jic.getQName(), ")");
      jm.addLine("return false;");
      jm.addEndIf();
      LocalJavaField other = jm.newJavaField(jic.getQName(), "other");
      other.addLine("(", jic.getQName(), ") ", o);
      jm.addIf("!", name, ".equals(", other, ".name)  ||  ", values, ".length != ",
          other, ".values.length");
      jm.addLine("return false;");
      jm.addEndIf();
      DirectAccessible loopVar = jm.addForArray(values);
      LocalJavaField v = jm.newJavaField(Object.class, "v");
View Full Code Here

      jm.addLine("return false;");
      jm.addEndIf();
      DirectAccessible loopVar = jm.addForArray(values);
      LocalJavaField v = jm.newJavaField(Object.class, "v");
      v.addLine(values, "[", loopVar, "]");
      jm.addIf(v, " == null");
      jm.addIf(other, ".values[", loopVar, "] != null");
      jm.addLine("return false;");
      jm.addEndIf();
      jm.addElse();
      jm.addIf("!", v, ".equals(", other, ".values[", loopVar, "])");
View Full Code Here

      jm.addEndIf();
      DirectAccessible loopVar = jm.addForArray(values);
      LocalJavaField v = jm.newJavaField(Object.class, "v");
      v.addLine(values, "[", loopVar, "]");
      jm.addIf(v, " == null");
      jm.addIf(other, ".values[", loopVar, "] != null");
      jm.addLine("return false;");
      jm.addEndIf();
      jm.addElse();
      jm.addIf("!", v, ".equals(", other, ".values[", loopVar, "])");
      jm.addLine("return false;");
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.