Examples of addThrowNew()


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

    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

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

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

        jm.addThrows(SAXException.class);
        jm.addTry();
        jm.addLine("return (", resultInterface, ") getData().getFactory().getElement(",
                   xmlElementInterface, ".class);");
        DirectAccessible e = jm.addCatch(JAXBException.class);
        jm.addThrowNew(SAXException.class, e);
        jm.addEndTry();
      } else {
        myTypeSG.getComplexTypeSG().generateXMLHandlerMethods(js);
      }
      return js;
View Full Code Here

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

    if (pController.getClassContext().isGlobal()) {
      jm.addTry();
      jm.addLine("return (", elementInterfaceClass, ") getData().getFactory().getElement(",
          elementInterfaceClass, ".class);");
      DirectAccessible e = jm.addCatch(JAXBException.class);
      jm.addThrowNew(SAXException.class, e);
      jm.addEndTry();
    } else {
      JavaQName elementImplClass = pController.getClassContext().getXMLImplementationName();
      jm.addLine("return new ", elementImplClass, "();");
    }
View Full Code Here

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

                   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

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

      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

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

    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

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

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

      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

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

        }
        if (!exceptionList.isEmpty()) {
            for (int i = 0;  i < exceptionList.size();  i++) {
              JavaQName exClass = (JavaQName) exceptionList.get(i);
                DirectAccessible e = jm.addCatch(exClass);
                jm.addThrowNew(UndeclaredThrowableException.class, e);
            }
            jm.addEndTry();
        }
        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.