Package org.apache.ws.jaxme.js

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


      }
      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);
        jm.addLine("return ", pController.getXMLFieldName(), ".remove(", pName, ") != null;");
      }
View Full Code Here


          String handlerMethodName = getXMLHandlersMethodName(particle.getPropertySG());

          JavaField jf = pSource.newJavaField(handlerFieldName, JMHandler.class, JavaSource.PRIVATE);
          JavaMethod jm2 = pSource.newJavaMethod(handlerMethodName, JMHandler.class, "protected");
          jm2.addThrows(SAXException.class);
          jm2.addIf(handlerFieldName, " == null");
         
          ComplexTypeSG childSG = typeSG.getComplexTypeSG();
          JavaQName handlerClassName = childSG.getClassContext().getXMLHandlerName();
          jm2.addTry();
          if (typeSG.isGlobalClass()) {
View Full Code Here

      boolean firstNamespace = true;
      for (Iterator iter = namespaces.iterator();  iter.hasNext()) {
          String uri = (String) iter.next();
          if ("".equals(uri)) {
              jm.addIf(firstNamespace, pNamespaceURI, " == null  ||  ", pNamespaceURI, ".length() == 0");
          } else {
              jm.addIf(firstNamespace, JavaSource.getQuoted(uri), ".equals(", pNamespaceURI, ")");
          }
          firstNamespace = false;
View Full Code Here

      for (Iterator iter = namespaces.iterator();  iter.hasNext()) {
          String uri = (String) iter.next();
          if ("".equals(uri)) {
              jm.addIf(firstNamespace, pNamespaceURI, " == null  ||  ", pNamespaceURI, ".length() == 0");
          } else {
              jm.addIf(firstNamespace, JavaSource.getQuoted(uri), ".equals(", pNamespaceURI, ")");
          }
          firstNamespace = false;

          extendXMLHandlersStartElementMethodAddNamespace(pController, pHandlerVar, pStateVar,
                                                        jm, uri, pNamespaceURI,
View Full Code Here

          jm.addEndIf();
      }
      jm.addBreak();
     
      jm.addDefault();
      jm.addIf(pHandlerVar, " == null");
      jm.addLine("super.startElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ", ", pAttr, ");");
      jm.addElse();
      jm.addLine(pHandlerVar, ".startElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ", ", pAttr, ");");
      jm.addEndIf();
  }
View Full Code Here

    DirectAccessible pNamespaceURI = jm.addParam(String.class, "pNamespaceURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    jm.addThrows(SAXException.class);

    jm.addIf(pHandlerVar, " == null");
    jm.addIf(pLevelVar, " > 1");
    jm.addLine("super.endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
    jm.addEndIf();
    jm.addElse();
    jm.addLine(pHandlerVar, ".endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
View Full Code Here

    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    jm.addThrows(SAXException.class);

    jm.addIf(pHandlerVar, " == null");
    jm.addIf(pLevelVar, " > 1");
    jm.addLine("super.endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
    jm.addEndIf();
    jm.addElse();
    jm.addLine(pHandlerVar, ".endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
    jm.addEndIf();
View Full Code Here

      // TODO: process group case properly.
      if (myParticles[i].isGroup()) continue;
      ObjectSG osg = child.getObjectSG();
      TypeSG childType = osg.getTypeSG();
      jm.addCase(Integer.toString(3+i));
      jm.addIf(pHandlerVar, " != null");
      jm.addLine(pHandlerVar, ".endDocument();");
      jm.addEndIf();
      Object v;
      JavaQName type;
      if (childType.isComplex()) {
View Full Code Here

    JavaMethod jm = pSource.newJavaMethod("characters", JavaQNameImpl.VOID, JavaSource.PUBLIC);
    DirectAccessible pChars = jm.addParam(char[].class, "pChars");
    DirectAccessible pOffset = jm.addParam(int.class, "pOffset");
    DirectAccessible pLen = jm.addParam(int.class, "pLen");
    jm.addThrows(SAXException.class);
    jm.addIf(pHandlerVar, " == null");
    jm.addLine("super.characters(", pChars,", ", pOffset, ", ", pLen, ");");
    jm.addElse();
    jm.addLine(pHandlerVar, ".characters(", pChars, ", ", pOffset, ", ", pLen, ");");
    jm.addEndIf();
    return jm;
View Full Code Here

      Column col = (Column) iter.next();
      if (sb.length() > 0) sb.append(", ");
      sb.append(col.getName().getName());
    }
    LocalJavaField query = jm.newJavaField(String.class);
    jm.addIf(pParams, " != null  &&  pParams.isDistinct()");
    jm.addLine(query, " = ", JavaSource.getQuoted("SELECT DISTINCT"), ";");
    jm.addElse();
    jm.addLine(query, " = ", JavaSource.getQuoted("SELECT"), ";");
    jm.addEndIf();
    jm.addLine(query, " += ", JavaSource.getQuoted(" " + sb + " FROM " + table.getQName()), ";");
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.