Examples of DirectAccessible


Examples of org.apache.ws.jaxme.js.DirectAccessible

    private TypedValue getParseCall(SimpleTypeSG pController, JavaMethod pMethod,
                                Object pValue, Object pData)
            throws SAXParseException {
        JavaQName type = getType(pController);
        DirectAccessible value = getValue(pMethod, pValue, JavaQNameImpl.getInstance(String.class));

        String parseMethod = javaType.getParseMethod().trim();
        List list = new ArrayList();
        if (parseMethod.startsWith("new")
            &&  parseMethod.length() > 3
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

    private TypedValue getPrintCall(SimpleTypeSG pController, JavaMethod pMethod,
                                Object pValue, Object pData) {
      JavaQName type = getType(pController);
        LocalJavaField f = pMethod.newJavaField(String.class);
        DirectAccessible value = getValue(pMethod, pValue, type);
        List list = new ArrayList();
        addCall(pController, list, javaType.getPrintMethod(), type);
        addValues(list, value, pData);
        pMethod.addTry();
        pMethod.addLine(f, " = ", list, ";");
        DirectAccessible e = pMethod.addCatch(Exception.class);
        pMethod.addLine(pData, ".printConversionEvent(pObject, ",
                        JavaSource.getQuoted("Failed to convert value "),
                        " + ", value, " + ", JavaSource.getQuoted(": "),
                        " + ", e, ".getClass().getName(), ", e, ");");
        pMethod.addLine(f, " = null;");
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

        }
      }
      else {
        runtimeType = pController.getRuntimeType();
      }
      DirectAccessible param = jm.addParam(runtimeType, pParamName);
      if (!pSource.isInterface()) {
        jm.addLine(pFieldName, " = ", param, ";");
      }
      return jm;
    } else {
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

      throws SAXException {
    LocalJavaField list = pMethod.newJavaField(LIST_TYPE);
    String collectionType = pController.getCollectionType();
    list.addLine("new ", ("indexed".equals(collectionType) ?
                          ARRAYLIST_TYPE : JavaQNameImpl.getInstance(collectionType, true)), "()");
    DirectAccessible st = pMethod.addForEnumeration(StringTokenizer.class, new Object[]{"new ", StringTokenizer.class, "(", pValue, ")"});
    pMethod.addLine(list, ".add(", itemType.getSimpleTypeSG().getCastFromString(pMethod, new Object[]{st, ".nextToken()"}, pData),
                    ");");
    pMethod.addEndFor();

    if ("indexed".equals(collectionType)) {
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

  }

  public TypedValue getCastToString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, DirectAccessible pData)
      throws SAXException {
    String collectionType = pController.getCollectionType();
    DirectAccessible value;
    if (pValue instanceof DirectAccessible) {
      value = (DirectAccessible) pValue;
    } else {
      LocalJavaField v = pMethod.newJavaField(pController.getRuntimeType());
      v.addLine(pValue);
      value = v;
    }

    LocalJavaField sb = pMethod.newJavaField(StringBuffer.class);
    sb.addLine("new ", StringBuffer.class, "()");
    Object v;
    DirectAccessible loopVar;
    if ("indexed".equals(collectionType)) {
      loopVar = pMethod.addForArray(value);
      v = new Object[]{value, "[", loopVar, "]"};
    } else {
      loopVar = pMethod.addForList(value);
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

            LocalJavaField resultA = pMethod.newJavaField(pType);
            pMethod.addIf(resultV , " == null");
            pMethod.addLine(resultA, " = null;");
            pMethod.addElse();
            pMethod.addLine(resultA, " = new ", pType.getInstanceClass(), "[", resultV, ".size()];");
            DirectAccessible i = pMethod.addForArray(resultA);
            Object element = new Object[]{resultV, ".elementAt(", i, ")"};
            pMethod.addLine(resultA, "[", i, "] = ", getResultValue(pMethod, pType.getInstanceClass(), element), ";");
            pMethod.addEndFor();
            pMethod.addEndIf();
            return resultA;
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

            LocalJavaField v = pMethod.newJavaField(Vector.class);
            pMethod.addIf(pValue, " == null");
            pMethod.addLine(v, " = null;");
            pMethod.addElse();
            pMethod.addLine(v, " = new ", Vector.class, "();");
            DirectAccessible i = pMethod.addForArray(pValue);
            Object element = new Object[]{pValue, "[", i, "]"};
            pMethod.addLine(v, ".add(", getInputValue(pMethod, pType.getInstanceClass(), element), ");");
            pMethod.addEndFor();
            pMethod.addEndIf();
            return v;
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

          jm.addLine("return ", getResultValue(jm, jm.getType(), result), ";");
        }
        if (!exceptionList.isEmpty()) {
            for (int i = 0;  i < exceptionList.size();  i++) {
              JavaQName exClass = (JavaQName) exceptionList.get(i);
                DirectAccessible e = jm.addCatch(exClass);
                jm.addThrowNew(UndeclaredThrowableException.class, e);
            }
            jm.addEndTry();
        }
        return jm;
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

                       JavaSource.getQuoted("Unknown method name: "),
                       " + ", name);
        jm.addEndIf();
        jm.addTry();
        jm.addLine("return ", invoker, ".invoke(", args, ");");
        DirectAccessible e = jm.addCatch(Exception.class);
        jm.addLine("throw ", e, ";");
        DirectAccessible t = jm.addCatch(Throwable.class);
        jm.addThrowNew(UndeclaredThrowableException.class, t);
        jm.addEndTry();
        return jm;
    }
View Full Code Here

Examples of org.apache.ws.jaxme.js.DirectAccessible

  protected void getFinally(JavaMethod pMethod, DirectAccessible pRessource, Object pSqlMsg,
                              Object pJaxbMsg) {
    pMethod.addLine(pRessource, ".close();");
    pMethod.addLine(pRessource, " = null;");
    if (pSqlMsg != null) {
      DirectAccessible e = pMethod.addCatch(SQLException.class);
      pMethod.addThrowNew(PMException.class, pSqlMsg, " + ", JavaSource.getQuoted(": "),
                          " + ", e, ".getMessage(), ", e);
    }
    if (pJaxbMsg != null) {
      DirectAccessible e = pMethod.addCatch(JAXBException.class);
      pMethod.addIf(e, " instanceof ", PMException.class);
      pMethod.addLine("throw (", PMException.class, ") ", e, ";");
      pMethod.addElse();
      pMethod.addThrowNew(PMException.class, pSqlMsg, " + ", JavaSource.getQuoted(": "),
                          " + ", e, ".getMessage(), ", e);
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.