Package org.apache.ws.jaxme.js

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


  protected void initLogging(JavaSource pSource) {
    if (isGeneratingLogging()) {
      JavaField jf = pSource.newJavaField("logger", Logger.class, JavaSource.PRIVATE);
      jf.setFinal(true);
      jf.setStatic(true);
      jf.addLine(LoggerAccess.class, ".getLogger(", pSource.getQName(), ".class)");
    }
  }

  /** <p>Creates code for logging the entrance into a method with
   * fine level.</p>
View Full Code Here


                                             JavaSource.PUBLIC);
    instance.newComment().addLine("The enumeration item with name " + itemName +
                                 " and value " + itemValue + ".");
    instance.setStatic(true);
    instance.setFinal(true);
    instance.addLine("new ", pSource.getQName(), "(", JavaSource.getQuoted(itemName),
                     ", ", JavaSource.getQuoted(itemValue), ")");

    if (i > 0) instanceList.add(", ");
     instanceList.add(instance);
    }
View Full Code Here

   JavaQName arrayType = JavaQNameImpl.getArray(pSource.getQName());
   JavaField allInstances = pSource.newJavaField("allInstances", arrayType,
                                                  JavaSource.PRIVATE);
   allInstances.setStatic(true);
   allInstances.setFinal(true);
   allInstances.addLine("new ", arrayType, "{", instanceList, "}");

   JavaMethod getName = pSource.newJavaMethod("getName", String.class,
                                               JavaSource.PUBLIC);
   getName.newComment().addLine("The enumeration items name.");
   getName.addLine("return ", name, ";");
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()) {
          Context myClassContext =
              child.getObjectSG().getTypeSG().getComplexTypeSG().getClassContext();
          JavaQName serializerClass = myClassContext.getXMLSerializerName();
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

      return null;
    }
    JavaQName runtimeType = JavaQNameImpl.getInstance(Map.class);
    JavaField jf = pSource.newJavaField(pController.getXMLFieldName(), runtimeType, JavaSource.PRIVATE);
    jf.setFinal(true);
    jf.addLine("new ", HashMap.class, "()");
    return jf;
  }

  protected JavaField getNamespaces(PropertySG pController, JavaSource pSource) throws SAXException {
      if (namespaceList.isAny()  ||  namespaceList.isOther()) {
View Full Code Here

          else {
            o = pDefaultValue;
          }
        }
        if (o != null) {
          jf.addLine(o);
        }
      }
      return jf;
    }
  }
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

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.