Package org.apache.ws.jaxme.js

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


        Object o = pController.getSimpleTypeSG().getInitialValue(pSource);
        if (o == null && pDefaultValue != null) {
            o = pController.getSimpleTypeSG().getCastFromString(pDefaultValue);
        }
        if (o != null) {
            jf.addLine(o);
        }
      }
      return jf;
    }
  }
View Full Code Here


    /** Creates the field with the {@link Map} of invokers.
     */
    protected JavaField getInvokerMap(JavaSource pSource) {
      JavaField result = pSource.newJavaField("map", Map.class, JavaSource.PRIVATE);
      result.addLine("new ", HashMap.class, "()");
        return result;
    }

    /** Creates a new invoker class for the given method.
     */
 
View Full Code Here

    public void generate(JavaMethod pMethod, Object pValue) throws SAXException {
      ObjectSG objectSG = child.getObjectSG();
      JavaField f = pMethod.getJavaSource().newJavaField(fieldName + "_qname", QName.class);
      f.setStatic(true);
      f.setFinal(true);
      f.addLine("new ", QName.class, "(", JavaSource.getQuoted(objectSG.getName().getNamespaceURI()),
                ", ", JavaSource.getQuoted(objectSG.getName().getLocalName()), ");");
      if (objectSG.getTypeSG().isComplex()) {
        pMethod.addLine(fieldName, ".marshal(", data, ", ", f, ", ", pValue, ");");
      } else {
        Object v = child.getObjectSG().getTypeSG().getSimpleTypeSG().getCastToString(pMethod, pValue, data);
View Full Code Here

    } else {
      JavaField jf = pSource.newJavaField(pFieldName, pController.getRuntimeType(), JavaSource.PRIVATE);
      if (!pController.isComplex()) {
        Object o = pController.getSimpleTypeSG().getInitialValue(pSource);
        if (o != null) {
          jf.addLine(o);
        }
      }
      return jf;
    }
  }
View Full Code Here

      }
      if (converter == null) {
        converter = js.newJavaField("__dataTypeConverter", qName);
        converter.setStatic(true);
        converter.setFinal(true);
        converter.addLine("new ", DatatypeConverterImpl.class, "()");
      }
      return new Object[]{converter, ".parse" + getDatatypeName() + "(", pValue, ")"};
    } else {
      return new Object[]{pData, ".getDatatypeConverter().parse" + getDatatypeName() + "(", pValue, ")"};
    }
View Full Code Here

    JavaField myName = js.newJavaField("__qName", QName.class, JavaSource.PRIVATE);
    myName.setStatic(true);
    myName.setFinal(true);
    XsQName qName = pController.getName();
    myName.addLine("new ", QName.class, "(", JavaSource.getQuoted(qName.getNamespaceURI()),
                   ", ", JavaSource.getQuoted(qName.getLocalName()), ")");

    JavaMethod getQName = js.newJavaMethod("getQName", QName.class, JavaSource.PUBLIC);
    getQName.addLine("return ", myName, ";");
View Full Code Here

  }

  public JavaField getXMLField(PropertySG pController, JavaSource pSource) throws SAXException {
    String fieldName = pController.getXMLFieldName();
    JavaField result = pSource.newJavaField(fieldName, List.class, JavaSource.PRIVATE);
    result.addLine("new ", ArrayList.class, "()");
    return result;
  }

  public JavaMethod getXMLSetMethod(PropertySG pController, JavaSource pSource) throws SAXException {
    return null;
View Full Code Here

    List instanceParams = new ArrayList();
    for (int i = 0;  i < values.length;  i++) {
      JavaField _f = js.newJavaField("_" + values[i].getName(), String.class, JavaSource.PUBLIC);
      _f.setStatic(true);
      _f.setFinal(true);
      _f.addLine(JavaSource.getQuoted(values[i].getName()));

      JavaField f = js.newJavaField(values[i].getName(), qName, JavaSource.PUBLIC);
      f.addLine("new ", qName, "(", JavaSource.getQuoted(values[i].getName()), ", ",
                super.getCastFromString(pController, values[i].getValue()), ", ",
                JavaSource.getQuoted(values[i].getValue()), ");");
View Full Code Here

      _f.setStatic(true);
      _f.setFinal(true);
      _f.addLine(JavaSource.getQuoted(values[i].getName()));

      JavaField f = js.newJavaField(values[i].getName(), qName, JavaSource.PUBLIC);
      f.addLine("new ", qName, "(", JavaSource.getQuoted(values[i].getName()), ", ",
                super.getCastFromString(pController, values[i].getValue()), ", ",
                JavaSource.getQuoted(values[i].getValue()), ");");
      f.setStatic(true);
      f.setFinal(true);
      if (!instanceParams.isEmpty()) instanceParams.add(", ");
View Full Code Here

      f.setFinal(true);
      if (!instanceParams.isEmpty()) instanceParams.add(", ");
      instanceParams.add(f);
    }
    JavaField instances = js.newJavaField("instances", qNameArray, JavaSource.PRIVATE);
    instances.addLine(new Object[]{"new ", qNameArray, "{", instanceParams, "}"});
    instances.setStatic(true);
    instances.setFinal(true);

    JavaConstructor con = js.newJavaConstructor(JavaSource.PRIVATE);
    DirectAccessible pName = con.addParam(String.class, "pName");
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.