Package org.apache.ws.jaxme.js

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


    i = fromNameMethod.addForArray(instances);
    fromNameMethod.addIf(instances, "[", i, "].name.equals(", pName, ")");
    fromNameMethod.addLine("return ", instances, "[", i, "];");
    fromNameMethod.addEndIf();
    fromNameMethod.addEndFor();
    fromNameMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid name: "),
                                " + ", pName);

    JavaMethod fromStringMethod = js.newJavaMethod("fromString", qName, JavaSource.PUBLIC);
    pValue = fromStringMethod.addParam(String.class, "pValue");
    fromStringMethod.setStatic(true);
View Full Code Here


      result.addCase(new Integer(getState(i)));
      ParticleSG particle = particles[i];
      handleEndElementState(result, element, particle);
    }
    result.addDefault();
    result.addThrowNew(IllegalStateException.class,
               JavaSource.getQuoted("Illegal state: "), " + ",
               getEndElementState());
    result.addEndSwitch();
    return result;
  }
View Full Code Here

                   result, getFirstValidParticle(state),
                   getLastValidParticle(state));
      result.addBreak();
    }
    result.addDefault();
    result.addThrowNew(IllegalStateException.class,
               JavaSource.getQuoted("Invalid state: "),
               " + ", getStateField());
    result.addEndSwitch();
    result.addLine("return false;");
    return result;
View Full Code Here

      result.addCase(new Integer(getState(i)));
      ParticleSG particle = particles[i];
      handleEndElementState(result, element, particle);
    }
    result.addDefault();
    result.addThrowNew(IllegalStateException.class,
               JavaSource.getQuoted("Illegal state: "), " + ",
               getEndElementState());
    result.addEndSwitch();
    return result;
  }
View Full Code Here

                   result, getFirstValidParticle(state),
                   getLastValidParticle(state));
      result.addBreak();
    }
    result.addDefault();
    result.addThrowNew(IllegalStateException.class,
               JavaSource.getQuoted("Invalid state: "),
               " + ", getStateField());
    result.addEndSwitch();
    result.addLine("return false;");
    return result;
View Full Code Here

    DirectAccessible i = fromValueMethod.addForArray(instances);
    fromValueMethod.addIf(pController.getEqualsCheck(fromValueMethod, new Object[]{instances, "[", i, "].value"}, pValue));
    fromValueMethod.addLine("return ", instances, "[", i, "];");
    fromValueMethod.addEndIf();
    fromValueMethod.addEndFor();
    fromValueMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid value: "),
                                " + ", pValue);

    JavaMethod fromNameMethod = js.newJavaMethod("fromName", qName, JavaSource.PUBLIC);
    pName = fromNameMethod.addParam(String.class, "pName");
    fromNameMethod.setStatic(true);
View Full Code Here

    i = fromNameMethod.addForArray(instances);
    fromNameMethod.addIf(instances, "[", i, "].name.equals(", pName, ")");
    fromNameMethod.addLine("return ", instances, "[", i, "];");
    fromNameMethod.addEndIf();
    fromNameMethod.addEndFor();
    fromNameMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid name: "),
                                " + ", pName);

    JavaMethod fromStringMethod = js.newJavaMethod("fromString", qName, JavaSource.PUBLIC);
    pValue = fromStringMethod.addParam(String.class, "pValue");
    fromStringMethod.setStatic(true);
View Full Code Here

          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);
        jm.addLine("return (", String.class, ") ", pController.getXMLFieldName(), ".get(", pName, ");");
      }
      return jm;
View Full Code Here

      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");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pValue argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
View Full Code Here

      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");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pValue argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
        jm.addLine(pController.getXMLFieldName(), ".put(", pName, ", ", pValue, ");");
      }
      return jm;
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.