Package org.apache.ws.jaxme.js

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


    jm.addIf("!", isStmtClosed);
    jm.addTry();
    jm.addLine(stmt, ".close();");
    jm.addCatch(Throwable.class, "ignore");
    jm.addEndTry();
    jm.addEndIf();
    jm.addEndTry();
   
    logFinestExiting(jm, null);
    return jm;
  }
View Full Code Here


      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;
  }

  protected JavaMethod getXMLSetElementMethod(PropertySG pController, JavaSource pSource) throws SAXException {
View Full Code Here

   }
   getInstanceByName.addElse();
   getInstanceByName.addLine("throw new ", IllegalArgumentException.class, "(",
                             JavaSource.getQuoted("Invalid name: "),
                              " + pName);");
   getInstanceByName.addEndIf();

   JavaMethod getInstanceByValue = pSource.newJavaMethod("getInstanceByValue",
                                       pSource.getQName(),
                                       JavaSource.PUBLIC);
   getInstanceByValue.setStatic(true);
View Full Code Here

   }
   getInstanceByValue.addElse();
   getInstanceByValue.addLine("throw new ", IllegalArgumentException.class, "(",
                      JavaSource.getQuoted("Invalid name: "),
                      " + pValue);");
   getInstanceByValue.addEndIf();

   if (isAddingEquals()) {
     JavaMethod equals = pSource.newJavaMethod("equals", JavaQNameImpl.BOOLEAN,
                                               JavaSource.PUBLIC);
     equals.addParam(Object.class, "o");
View Full Code Here

     JavaMethod equals = pSource.newJavaMethod("equals", JavaQNameImpl.BOOLEAN,
                                               JavaSource.PUBLIC);
     equals.addParam(Object.class, "o");
     equals.addIf("o == null  ||  !(o instanceof ", pSource.getQName(), ")");
     equals.addLine("return false;");
     equals.addEndIf();
     equals.addLine("return name.equals(((", pSource.getQName(), ") o).name);");

      JavaMethod hashCode = pSource.newJavaMethod("hashCode", JavaQNameImpl.INT,
                                                  JavaSource.PUBLIC);
      hashCode.addLine("return name.hashCode();");
View Full Code Here

        Object v = myAttributes[i].getTypeSG().getSimpleTypeSG().getCastFromString(jm, pValue, "getHandler()");
        attr.getPropertySG().setValue(jm, result, v, null);
        jm.addLine("return;");
      }
      if (!firstInNamespace) {
        jm.addEndIf();
      }
    }
    if (!first) {
      jm.addEndIf();
    }
View Full Code Here

      if (!firstInNamespace) {
        jm.addEndIf();
      }
    }
    if (!first) {
      jm.addEndIf();
    }
   
    AttributeSG wildcard = null;
    for (int i = 0;  i < myAttributes.length;  i++) {
      if (myAttributes[i].isWildcard()) {
View Full Code Here

    JavaMethod jm = getJavaSource().newJavaMethod("getPreferredPrefix", String.class, JavaSource.PUBLIC);
    DirectAccessible pURI = jm.addParam(String.class, "pURI");
    if (!uris.isEmpty()) {
      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();
        String uri = (String) entry.getKey();
        String prefix = (String) entry.getValue();
View Full Code Here

        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 null;");
    return jm;
  }
}
View Full Code Here

    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);
    result.addLine("(", resultType, ") result");
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.