Package org.apache.ws.jaxme.js

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


                 JAXBContext.class, ".newInstance(",
                 JavaSource.getQuoted(pPackageName), ");");

    JavaMethod newInstanceMethod = js.newJavaMethod("newInstance", Object.class, "public");
    newInstanceMethod.addThrows(JAXBException.class);
    Parameter pElementInterface = newInstanceMethod.addParam(Class.class, "pElementInterface");
    newInstanceMethod.addLine("return ", jf, ".getManager(", pElementInterface, ").getElementJ();");

    {
      JavaMethod getPropertyMethod = js.newJavaMethod("getProperty", Object.class, "public");
      Parameter pName = getPropertyMethod.addParam(String.class, "pName");
      getPropertyMethod.addIf(properties, " == null");
      getPropertyMethod.addLine("return null;");
      getPropertyMethod.addEndIf();
      getPropertyMethod.addLine("return ", properties, ".get(", pName, ");");
    }

    {
      JavaMethod setPropertyMethod = js.newJavaMethod("setProperty", void.class, "public");
      Parameter pName = setPropertyMethod.addParam(String.class, "pName");
      Parameter pValue = setPropertyMethod.addParam(Object.class, "pValue");
      setPropertyMethod.addIf(properties, " == null");
      setPropertyMethod.addLine(properties, " = new ", HashMap.class, "();");
      setPropertyMethod.addEndIf();
      setPropertyMethod.addLine(properties, ".put(", pName, ", ", pValue, ");");
    }
View Full Code Here


      jc.addLine("@return Attribute value or null, if the attribute is not set.");
      jc.addLine("@throws NullPointerException The <code>pName</code> argument is null.");
      if (!namespaceList.isAny()) {
          jc.addLine("@throws IllegalArgumentException The namespace <code>pName.getNamespaceURI()</code> is invalid.");
      }
      Parameter pName = jm.addParam(QName.class, "pName");
      if (!pSource.isInterface()) {
        jm.addIf(pName, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pName argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
View Full Code Here

      jc.addLine("<p>Sets the 'anyAttribute' named <code>pName</code> to the value <code>pValue</code>.</p>");
      if (!namespaceList.isAny()) {
          jc.addLine("@throws IllegalArgumentException The namespace <code>pName.getNamespaceURI()</code> is invalid.");
      }
      jc.addLine("@throws NullPointerException Either of the arguments <code>pName</code> or <code>pValue</code> is null.");
      Parameter pName = jm.addParam(QName.class, "pName");
      Parameter pValue = jm.addParam(String.class, "pValue");
      if (!pSource.isInterface()) {
        jm.addIf(pName, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pName argument must not be null."));
        jm.addEndIf();
        jm.addIf(pValue, " == null");
View Full Code Here

      if (!namespaceList.isAny()) {
          jc.addLine("@throws IllegalArgumentException The namespace <code>pName.getNamespaceURI()</code> is invalid.");
      }
      jc.addLine("@throws NullPointerException Either of the arguments <code>pName</code> or <code>pValue</code> is null.");
      jc.addLine("@return True, if the attribute was set, otherwise false.");
      Parameter pName = jm.addParam(QName.class, "pName");
      if (!pSource.isInterface()) {
        jm.addIf(pName, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pName argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
View Full Code Here

      if (placeHolder == null) {
          throw new IllegalStateException("No such placeholder: 'GroupSG' in method 'startElement'");
      }
      placeHolder.remove();
      Parameter[] parameters = jm.getParams();
      Parameter pNamespaceURI = parameters[0];
      Parameter pLocalName = parameters[1];
      Parameter pQName = parameters[2];
      Parameter pAttr = parameters[3];
     
      jm.addCase("1");
      Set namespaces = new HashSet();
      for (int i = 0;  i < myParticles.length;  i++) {
          ParticleSG child = myParticles[i];
View Full Code Here

                 JAXBContext.class, ".newInstance(",
                 JavaSource.getQuoted(pPackageName), ");");

    JavaMethod newInstanceMethod = js.newJavaMethod("newInstance", Object.class, "public");
    newInstanceMethod.addThrows(JAXBException.class);
    Parameter pElementInterface = newInstanceMethod.addParam(Class.class, "pElementInterface");
    newInstanceMethod.addLine("return ", jf, ".getElement(", pElementInterface, ");");

    {
      JavaMethod getPropertyMethod = js.newJavaMethod("getProperty", Object.class, "public");
      Parameter pName = getPropertyMethod.addParam(String.class, "pName");
      getPropertyMethod.addIf(properties, " == null");
      getPropertyMethod.addLine("return null;");
      getPropertyMethod.addEndIf();
      getPropertyMethod.addLine("return ", properties, ".get(", pName, ");");
    }

    {
      JavaMethod setPropertyMethod = js.newJavaMethod("setProperty", void.class, "public");
      Parameter pName = setPropertyMethod.addParam(String.class, "pName");
      Parameter pValue = setPropertyMethod.addParam(Object.class, "pValue");
      setPropertyMethod.addIf(properties, " == null");
      setPropertyMethod.addLine(properties, " = new ", HashMap.class, "();");
      setPropertyMethod.addEndIf();
      setPropertyMethod.addLine(properties, ".put(", pName, ", ", pValue, ");");
    }
View Full Code Here

    public JavaMethod getXMLSetMethod(PropertySG pController, JavaSource pSource) throws SAXException {
        String fieldName = pController.getXMLFieldName();
        String methodName = pController.getXMLSetMethodName();
        JavaMethod result = pSource.newJavaMethod(methodName, void.class, JavaSource.PUBLIC);
        Parameter param = result.addParam(Object.class, "p" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1));
        result.addLine(fieldName, " = ", param, ";");
        return result;
    }
View Full Code Here

  }

  protected JavaMethod getXMLSerializersMarshalChildsMethod(ComplexTypeSG pController, JavaSource pSource) throws SAXException {
      JavaMethod jm = pSource.newJavaMethod("marshalChilds", void.class, JavaSource.PUBLIC);
      jm.addThrows(SAXException.class);
      Parameter pData = jm.addParam(JMXmlSerializer.Data.class, "pData");
      Parameter pElement = jm.addParam(Object.class, "pElement");
      JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
      LocalJavaField element = jm.newJavaField(elementInterface);
      element.addLine("(", elementInterface, ") ", pElement);
      LocalJavaField chars = jm.newJavaField(String.class);
      SimpleContentSG simpleContent = pController.getSimpleContentSG();
View Full Code Here

                            JavaField pLevelVar) throws SAXException {
      if (!pController.hasSimpleContent()) {
          return null;
      }
      JavaMethod jm = pSource.newJavaMethod("characters", void.class, JavaSource.PUBLIC);
      Parameter buffer = jm.addParam(char[].class, "pChars");
      Parameter offset = jm.addParam(int.class, "pOffset");
      Parameter length = jm.addParam(int.class, "pLength");
      jm.addThrows(SAXException.class);
      jm.addIf(pLevelVar, " == 1");
      jm.addLine("__content.append(", buffer, ", ", offset, ", ", length, ");");
      jm.addEndIf();
      return jm;
View Full Code Here

  }

  protected JavaMethod getXMLSerializersMarshalChildsMethod(ComplexTypeSG pController, JavaSource pSource) throws SAXException {
      JavaMethod jm = pSource.newJavaMethod("marshalChilds", void.class, JavaSource.PUBLIC);
      jm.addThrows(SAXException.class);
      Parameter pData = jm.addParam(JMXmlSerializer.Data.class, "pData");
      Parameter pElement = jm.addParam(Object.class, "pElement");
      JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
      LocalJavaField element = jm.newJavaField(elementInterface);
      element.addLine("(", elementInterface, ") ", pElement);
      LocalJavaField chars = jm.newJavaField(String.class);
      SimpleContentSG simpleContent = pController.getSimpleContentSG();
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.js.Parameter

Copyright © 2018 www.massapicom. 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.