Package org.apache.ws.jaxme.js

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


    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG child = myParticles[i];
      ObjectSG osg = child.getObjectSG();
      TypeSG childType = osg.getTypeSG();
      jm.addCase(Integer.toString(3+i));
      jm.addIf(pHandlerVar, " != null");
      jm.addLine(pHandlerVar, ".endDocument();");
      jm.addEndIf();
      Object v;
      JavaQName type;
      if (childType.isComplex()) {
View Full Code Here


    JavaMethod jm = pSource.newJavaMethod("characters", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    DirectAccessible pChars = jm.addParam(char[].class, "pChars");
    DirectAccessible pOffset = jm.addParam(int.class, "pOffset");
    DirectAccessible pLen = jm.addParam(int.class, "pLen");
    jm.addThrows(SAXException.class);
    jm.addIf(pHandlerVar, " == null");
    jm.addLine("super.characters(", pChars,", ", pOffset, ", ", pLen, ");");
    jm.addElse();
    jm.addLine(pHandlerVar, ".characters(", pChars, ", ", pOffset, ", ", pLen, ");");
    jm.addEndIf();
    return jm;
View Full Code Here

    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

    {
      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

    if (uris.isEmpty()) {
      return null;
    }
    JavaMethod jm = pSource.newJavaMethod("getPreferredPrefix", String.class, JavaSource.PUBLIC);
    DirectAccessible pURI = jm.addParam(String.class, "pURI");
    jm.addIf(pURI, " == null");
    jm.addLine(pURI, " = \"\";");
    jm.addEndIf();
    boolean first = true;
    for (Iterator iter = uris.entrySet().iterator();  iter.hasNext()) {
      Map.Entry entry = (Map.Entry) iter.next();
View Full Code Here

    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();
    jm.addLine("return super.getPreferredPrefix(", pURI, ");");
View Full Code Here

    JavaMethod jm = pSource.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 = pController.getClassContext().getXMLInterfaceName();
    LocalJavaField result = jm.newJavaField(resultType);
View Full Code Here

      // Skip, if this namespace was already processed.
      if (uris.contains(uri)) {
        continue;
      }

      jm.addIf(uris.isEmpty(), JavaSource.getQuoted(uri), ".equals(", pURI, ")");
      for (int j = i;  j < myAttributes.length;  j++) {
        attr = myAttributes[j];
        String jUri = attr.getName().getNamespaceURI();
        if (jUri == null) { jUri = ""; }
        if (!uri.equals(jUri)) {
View Full Code Here

        if (jUri == null) { jUri = ""; }
        if (!uri.equals(jUri)) {
          continue;
        }

        jm.addIf(j == i, JavaSource.getQuoted(attr.getName().getLocalName()), ".equals(", pLocalName, ")");
        Object v = myAttributes[j].getTypeSG().getSimpleTypeSG().getCastFromString(jm, pValue, "getData()");
        attr.getPropertySG().setValue(jm, result, v, null);
        jm.addLine("return;");
      }
      jm.addEndIf();
View Full Code Here

    jm.addSwitch(pLevelVar, "++");
    jm.addCase("0");

    jm.addLine("setResult(newResult());");
    jm.addIf(pAttr, " != null");

    String iVar = jm.getLocalVariableName();
    jm.addFor("int ", iVar, " = 0;  ", iVar, " < pAttr.getLength();  ", iVar, "++");
    AttributeSG[] myAttributes = pController.getAttributes();
    if (myAttributes.length == 0) {
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.