Examples of addLine()


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

    if (!pSource.isInterface()) {
      if (pController.getRuntimeType().isPrimitive()) {
        JavaField jf = pSource.newJavaField(getIsSetCheckFieldName(pFieldName), BooleanSG.BOOLEAN_TYPE);
        jm.addLine("return ", jf, ";");
      } else {
        jm.addLine("return (" + pFieldName + " != null);");
      }
    }
    return jm;
  }
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

    private DirectAccessible getValue(JavaMethod pMethod, Object pValue, JavaQName pType) {
        if (pValue instanceof DirectAccessible) {
          return (DirectAccessible) pValue;
        } else {
            LocalJavaField s = pMethod.newJavaField(pType);
            s.addLine(pValue);
            return s;
        }
    }

    private void addValues(List pList, DirectAccessible pValue, Object pData) {
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

  public TypedValue getCastFromString(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, Object pData)
      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();
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

    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, "()");
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

      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, "]"};
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

    return new TypedValueImpl(new Object[]{sb, ".toString()"}, String.class);
  }

  public void forAllNonNullValues(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, SGlet pSGlet) throws SAXException {
    LocalJavaField f = pMethod.newJavaField(LIST_TYPE);
    f.addLine(pValue);
    pMethod.addIf(f, " != null");
    pSGlet.generate(pMethod, f);
    pMethod.addEndIf();
  }
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

                            ".getJMUnmarshaller()).get" + getDatatypeName(), "Format()"};
            mayBeDate = true;
        }
        if (!(pValue instanceof DirectAccessible)) {
            LocalJavaField v = pMethod.newJavaField(String.class);
            v.addLine(pValue);
            pValue = v;
        }
        LocalJavaField pos = pMethod.newJavaField(ParsePosition.class);
        pos.addLine("new ", ParsePosition.class, "(0)");
        LocalJavaField cal = pMethod.newJavaField(mayBeDate ? OBJECT_TYPE : pController.getRuntimeType());
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

            LocalJavaField v = pMethod.newJavaField(String.class);
            v.addLine(pValue);
            pValue = v;
        }
        LocalJavaField pos = pMethod.newJavaField(ParsePosition.class);
        pos.addLine("new ", ParsePosition.class, "(0)");
        LocalJavaField cal = pMethod.newJavaField(mayBeDate ? OBJECT_TYPE : pController.getRuntimeType());
        cal.addLine(format, ".parseObject(", pValue, ", ", pos, ");");
        pMethod.addIf(cal, " == null");
        pMethod.addThrowNew(IllegalArgumentException.class,
                      JavaSource.getQuoted("Failed to parse dateTime "),
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

            pValue = v;
        }
        LocalJavaField pos = pMethod.newJavaField(ParsePosition.class);
        pos.addLine("new ", ParsePosition.class, "(0)");
        LocalJavaField cal = pMethod.newJavaField(mayBeDate ? OBJECT_TYPE : pController.getRuntimeType());
        cal.addLine(format, ".parseObject(", pValue, ", ", pos, ");");
        pMethod.addIf(cal, " == null");
        pMethod.addThrowNew(IllegalArgumentException.class,
                      JavaSource.getQuoted("Failed to parse dateTime "),
                        " + ", pValue, " + ", JavaSource.getQuoted(" at: "),
              " + ", pValue, ".substring(", pos, ".getErrorIndex())");
View Full Code Here

Examples of org.apache.ws.jaxme.js.LocalJavaField.addLine()

        }
    }

  public void forAllNonNullValues(SimpleTypeSG pController, JavaMethod pMethod, Object pValue, SGlet pSGlet) throws SAXException {
    LocalJavaField f = pMethod.newJavaField(CALENDAR_TYPE);
    f.addLine(pValue);
    pMethod.addIf(f, " != null");
    pSGlet.generate(pMethod, pValue);
    pMethod.addEndIf();
  }
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.