Package org.apache.ws.jaxme.js

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


      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


      if (isAutoBoxing()) {
        LocalJavaField res = result.newJavaField(getArrayClass());
        res.addLine(o);
        DirectAccessible i = result.addForList(int.class, fieldName);
        result.addLine(res, "[", i, "] = ", asPrimitive(i, fieldName), ";");
        result.addEndFor();
        result.addLine("return ", res, ";");
      } else {
        result.addLine("return (", arrayClass, ") ", fieldName,
            ".toArray(", o, ");");
      }
View Full Code Here

      result.addLine(fieldName, ".clear();");
      result.addIf(array, " != null");
      DirectAccessible i = result.addForArray(int.class, array);
      Object o = new Object[]{array, "[", i, "]"};
      result.addLine(fieldName, ".add(", asObject(o), ");");
      result.addEndFor();
      result.addEndIf();
    }
    return result;
  }
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

    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

      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

      if (isAutoBoxing()) {
        LocalJavaField res = result.newJavaField(getArrayClass());
        res.addLine(o);
        DirectAccessible i = result.addForList(int.class, fieldName);
        result.addLine(res, "[", i, "] = ", asPrimitive(i, fieldName), ";");
        result.addEndFor();
        result.addLine("return ", res, ";");
      } else {
        result.addLine("return (", arrayClass, ") ", fieldName,
            ".toArray(", o, ");");
      }
View Full Code Here

      result.addLine(fieldName, ".clear();");
      result.addIf(array, " != null");
      DirectAccessible i = result.addForArray(int.class, array);
      Object o = new Object[]{array, "[", i, "]"};
      result.addLine(fieldName, ".add(", asObject(o), ");");
      result.addEndFor();
      result.addEndIf();
    }
    return result;
  }
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

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.