public void setFeature(String name, boolean value) throws ParserConfigurationException {
   //     fact.setFeature(name, value);
   try {
     invoke("setFeature", argsSetFeature, new Object[] {name, Boolean.valueOf(value)});
   } catch (InvocationTargetException e) {
     if (e.getCause() instanceof ParserConfigurationException) {
       throw (ParserConfigurationException) e.getCause();
     }
     if (e.getCause() instanceof RuntimeException) {
       throw (RuntimeException) e.getCause();
     }
     throw new RuntimeException(e);
   }
 }
 public boolean getFeature(String name) throws ParserConfigurationException {
   //     return fact.getFeature(name);
   try {
     Object res = invoke("getFeatureccc", argsGetFeature, new Object[] {name});
     return ((Boolean) res).booleanValue();
   } catch (InvocationTargetException e) {
     if (e.getCause() instanceof ParserConfigurationException) {
       throw (ParserConfigurationException) e.getCause();
     }
     if (e.getCause() instanceof RuntimeException) {
       throw (RuntimeException) e.getCause();
     }
     throw new RuntimeException(e);
   }
 }
Ejemplo n.º 3
0
 protected PsmEvent run(PsmEvent event, PsmInterp interp, Object[] argArray) {
   try {
     return (PsmEvent) method.invoke(null, argArray);
   } catch (IllegalAccessException ex) {
     // This really should never happen, given the checks at
     // construction time.
     throw new PsmMethodActionException(ex.toString());
   } catch (InvocationTargetException ex) {
     // This may occur if the method throws a runtime exception.  Rather
     // than wrap it in a PsmMethodActionException, let it percolate up.
     // If not a RuntimeException, wrap it in a PsmMethodActionException.
     Throwable th = ex.getTargetException();
     if (th instanceof RuntimeException) {
       throw (RuntimeException) th;
     } else {
       throw new PsmMethodActionException(
           "Exception thrown from " + "target method invocation " + " is not a Runtime Exception",
           th);
     }
   }
 }