public DefaultStep(XProcRuntime runtime, XAtomicStep step) { this.runtime = runtime; this.step = step; Class impl = runtime.getConfiguration().implementations.get(step.getType()); if (impl == null) { // We're headed for a world of hurt... logger = LoggerFactory.getLogger(DefaultStep.class); } else { logger = LoggerFactory.getLogger(impl); } }
public DefaultStep(XProcRuntime runtime, XAtomicStep step) { this.runtime = runtime; this.step = step; Class impl = runtime.getConfiguration().implementations.get(step.getType()); if (impl == null) { // We're headed for a world of hurt... logger = LoggerFactory.getLogger(DefaultStep.class); } else { logger = LoggerFactory.getLogger(impl); } }
public void run(String addnLog) { String type = null; if (XProcConstants.NS_XPROC.equals(step.getType().getNamespaceURI())) { type = step.getType().getLocalName(); } else { type = step.getType().getClarkName(); } logger.debug("Running " + type + " " + step.getName() + addnLog); String msg = step.getExtensionAttribute(cx_message); if (msg != null) { System.err.println("Message: " + msg); } }
public void run(String addnLog) { String type = null; if (XProcConstants.NS_XPROC.equals(step.getType().getNamespaceURI())) { type = step.getType().getLocalName(); } else { type = step.getType().getClarkName(); } logger.debug("Running " + type + " " + step.getName() + addnLog); String msg = step.getExtensionAttribute(cx_message); if (msg != null) { System.err.println("Message: " + msg); } }
public XProcStep newStep(XProcRuntime runtime,XAtomicStep step){ Class<?> klass = implementations.get(step.getType()); if (klass == null) { throw new XProcException("Misconfigured. No 'class' in configuration for " + step.getType()); } String className = klass.getName(); // FIXME: This isn't really very secure... if (runtime.getSafeMode() && !className.startsWith("com.xmlcalabash.")) { throw XProcException.dynamicError(21); } try { Constructor<? extends XProcStep> constructor = Class.forName(className).asSubclass(XProcStep.class).getConstructor(XProcRuntime.class, XAtomicStep.class); return constructor.newInstance(runtime,step); } catch (NoSuchMethodException nsme) { throw new UnsupportedOperationException("No such method: " + className, nsme); } catch (ClassNotFoundException cfne) { throw new UnsupportedOperationException("Class not found: " + className, cfne); } catch (InstantiationException ie) { throw new UnsupportedOperationException("Instantiation error", ie); } catch (IllegalAccessException iae) { throw new UnsupportedOperationException("Illegal access error", iae); } catch (InvocationTargetException ite) { throw new UnsupportedOperationException("Invocation target exception", ite); } }
public XProcStep newStep(XProcRuntime runtime,XAtomicStep step){ Class<?> klass = implementations.get(step.getType()); if (klass == null) { throw new XProcException("Misconfigured. No 'class' in configuration for " + step.getType()); } String className = klass.getName(); // FIXME: This isn't really very secure... if (runtime.getSafeMode() && !className.startsWith("com.xmlcalabash.")) { throw XProcException.dynamicError(21); } try { Constructor<? extends XProcStep> constructor = Class.forName(className).asSubclass(XProcStep.class).getConstructor(XProcRuntime.class, XAtomicStep.class); return constructor.newInstance(runtime,step); } catch (NoSuchMethodException nsme) { throw new UnsupportedOperationException("No such method: " + className, nsme); } catch (ClassNotFoundException cfne) { throw new UnsupportedOperationException("Class not found: " + className, cfne); } catch (InstantiationException ie) { throw new UnsupportedOperationException("Instantiation error", ie); } catch (IllegalAccessException iae) { throw new UnsupportedOperationException("Illegal access error", iae); } catch (InvocationTargetException ite) { throw new UnsupportedOperationException("Invocation target exception", ite); } }
@Override public XProcStep newStep(XProcRuntime runtime, XAtomicStep step) { if (step == null) { return null; } else { XProcStep xprocStep = stepRegistry.newStep(step.getType(), runtime, step); return (xprocStep != null) ? xprocStep : super.newStep(runtime, step); } }