|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xml_project.morganaxproc.core.steptypes.Step com.xml_project.morganaxproc.core.steptypes.ContainerStep com.xml_project.morganaxproc.core.steptypes.CompoundStep com.xml_project.morganaxproc.core.steptypes.RunnableStep com.xml_project.morganaxproc.core.steptypes.BuildInStep com.xml_project.morganaxproc.core.steptypes.AtomicStep
public abstract class AtomicStep
This abstract class should be used as base class for XProc extension steps written in java.
For details see the documentation.
Apart from declaring the input ports, options and output ports for the new step, you have to provide two static methods for MorganaXProc to recognize your step. These two methods must have the following signature:
public static makeNewInstance( CompilationContext context, String stepname, CompoundStep parent, Integer line, Integer column, Attribute[] extensionAttributes);
Nested Class Summary | |
---|---|
class |
AtomicStep.IllegalAccessException
|
Nested classes/interfaces inherited from class com.xml_project.morganaxproc.core.steptypes.Step |
---|
com.xml_project.morganaxproc.core.steptypes.Step.PortTestModes |
Field Summary |
---|
Fields inherited from class com.xml_project.morganaxproc.core.steptypes.BuildInStep |
---|
NewInstanceSignature |
Fields inherited from class com.xml_project.morganaxproc.core.steptypes.Step |
---|
stepErrors |
Constructor Summary | |
---|---|
protected |
AtomicStep(com.xml_project.morganaxproc.core.CompilationContext context,
String name,
com.xml_project.morganaxproc.core.steptypes.CompoundStep parent,
int line,
int column,
nu.xom.Attribute[] extensionAttributes)
|
Method Summary | |
---|---|
XPathInXProcSelector |
compileXPath(String xpathExpression,
String baseUri,
com.xml_project.xom.XOMUtilities.NamespaceMap declaredNamespaces)
Prepares an XPath expression for evaluation |
XPathInXProcSequence |
compileXPath(String xpathExpression,
String baseUri,
com.xml_project.xom.XOMUtilities.NamespaceMap declaredNamespaces,
nu.xom.Document[] sequence)
Prepares an XPath expression for a sequence evaluation |
XPathInXProcPattern |
compileXPathPattern(String patternExpression,
String baseUri,
com.xml_project.xom.XOMUtilities.NamespaceMap declaredNamespaces)
Prepares an XPath match pattern for evaluation |
void |
declareInputPort(String name,
boolean sequence,
boolean primary)
Declares a new input port for the step. |
void |
declareOption(QName name,
SequenceType type,
String value)
Declares a new option with a default value. |
void |
declareOutputPort(String name,
boolean sequence,
boolean primary)
Declares a new output port for the step. |
void |
declareRequiredOption(QName name,
SequenceType type)
Declares a new required option. |
protected abstract void |
execute(String stepURI)
This method must be implemented for the new step |
com.xml_project.morganaxproc.core.XProcRuntime.PortValueMap |
execute(com.xml_project.morganaxproc.core.XProcRuntime runtime,
com.xml_project.morganaxproc.core.XProcRuntime.PortValueMap init,
com.xml_project.morganaxproc.core.XProcRuntime.ValueMap options,
String stepURI)
This method is a wrapper around the abstract execute method. |
protected nu.xom.Document |
getInputPortDocument(String portName)
Returns the first document of the named port. |
protected nu.xom.Document[] |
getInputPortDocuments(String portName)
Returns the documents of the named port. |
protected OptionValue |
getOptionValue(QName name)
Returns the OptionValue of the named option. |
protected String |
getOptionValueAsString(QName name)
Returns the value of the named option as String |
protected void |
setOutputPortDocument(String portName,
nu.xom.Document document)
Puts a single document on the named port. |
protected void |
setOutputPortDocuments(String portName,
nu.xom.Document[] documents)
Puts a sequence of documents on the named port. |
Methods inherited from class com.xml_project.morganaxproc.core.steptypes.BuildInStep |
---|
checkStepConnections, discoverDependencies, fixParameterPorts, makeAttribute, makeWrapper, setDocumentConnection, setParameter |
Methods inherited from class com.xml_project.morganaxproc.core.steptypes.RunnableStep |
---|
checkAllOptionsDeclared, compileDeclareStep, compileLibrary, declareOption, dumpPorts, fixBinding, getAllDeclaredPipeline, getAllDeclaredPipeline, getDeclaredOptionNames, getDeclaredOptions, getExcludeInlinePrefixes, getFunction, getLoadedStep, getLoadErrorMessage, getLocalDeclaredPipeline, getOptionDeclaration, getOptionValues, getRequiredXPathVersion, getSerializer, getSubpipelineContainer, getType, getXProcPrefix, getXProcVersion, isDeclaredOption, isImportHead, PSVI_is_Required, run, setSubpipeline |
Methods inherited from class com.xml_project.morganaxproc.core.steptypes.CompoundStep |
---|
addStep, checkSpecialConnections, compilePipelineCall, compileSubpipeline, compileSubpipeline, finish, getDefaultReadablePort, getNumberOfSteps, getStep, getStep, getStepNr |
Methods inherited from class com.xml_project.morganaxproc.core.steptypes.ContainerStep |
---|
addVariable, evaluateVariables, fixVariableBinding, fixVariableBinding, getNumberOfVariables, getVariableDeclaration, isDeclaredOptionOrVariable, parseNamespacesElements, parseVariableDeclaration |
Methods inherited from class com.xml_project.morganaxproc.core.steptypes.Step |
---|
checkAndPutResult, checkAndPutResult, checkForLoops, declareImplicitOutputPort, declareInputPort, declareOutputPort, declareParameterPort, dumpPorts, findStepWithReadableOutputPort, getColumnNumber, getDeclaredInputAndParameterPorts, getDeclaredInputPorts, getDeclaredOutputPorts, getDeclaredParameterPorts, getExtensionAttribute, getExtensionAttributes, getInputPort, getLineNumber, getName, getOutputPort, getParameterPort, getParent, getPrimaryInputPort, getPrimaryOutputPort, getPrimaryParameterPort, getStepType, getStepWithFunctionLibrary, getURI, handleXPathException, hasInputPort, hasName, hasOutputPort, hasParameterPort, hasParent, isParentInputPort, isRunnable, makePortValueMap, parseLogStep, registerConnection, searchPrimaryInputPort, setOutputPortToSequence |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AtomicStep(com.xml_project.morganaxproc.core.CompilationContext context, String name, com.xml_project.morganaxproc.core.steptypes.CompoundStep parent, int line, int column, nu.xom.Attribute[] extensionAttributes)
Method Detail |
---|
public final void declareInputPort(String name, boolean sequence, boolean primary)
Declares a new input port for the step. Always set primary for the primary input step even if this is implicitly clear.
name
- new port's namesequence
- new port's sequence attributeprimary
- new port's primary attributepublic final void declareOutputPort(String name, boolean sequence, boolean primary)
Declares a new output port for the step. Always set primary for the primary output step even if this is implicitly clear.
name
- new port's namesequence
- new port's sequence attributeprimary
- new port's primary attributepublic final void declareOption(QName name, SequenceType type, String value)
Declares a new option with a default value.
name
- new option's nametype
- new option's XPathSequenceTypevalue
- new option's default value or null for no default value.public final void declareRequiredOption(QName name, SequenceType type)
Declares a new required option.
name
- new option's name.type
- new option's typepublic final com.xml_project.morganaxproc.core.XProcRuntime.PortValueMap execute(com.xml_project.morganaxproc.core.XProcRuntime runtime, com.xml_project.morganaxproc.core.XProcRuntime.PortValueMap init, com.xml_project.morganaxproc.core.XProcRuntime.ValueMap options, String stepURI) throws com.xml_project.morganaxproc.core.XProcRuntimeException, com.xml_project.morganaxproc.core.StepException
execute
in class com.xml_project.morganaxproc.core.steptypes.BuildInStep
com.xml_project.morganaxproc.core.XProcRuntimeException
com.xml_project.morganaxproc.core.StepException
public final XPathInXProcPattern compileXPathPattern(String patternExpression, String baseUri, com.xml_project.xom.XOMUtilities.NamespaceMap declaredNamespaces) throws AtomicStep.IllegalAccessException, XPathException
Prepares an XPath match pattern for evaluation
patternExpression
- the match pattern expression to be prepared for evaluation.baseUri
- the base uri for this evaluationdeclaredNamespaces
- the namespace declarations for this match pattern expression.
AtomicStep.IllegalAccessException
- if method is called outside 'execute(String)'.
XPathException
- if an error occurred in preparing the xpath.public final XPathInXProcSelector compileXPath(String xpathExpression, String baseUri, com.xml_project.xom.XOMUtilities.NamespaceMap declaredNamespaces) throws AtomicStep.IllegalAccessException, XPathException
Prepares an XPath expression for evaluation
xpathExpression
- the XPath expression to be prepared for evaluation.baseUri
- the base uri for this evaluation.declaredNamespaces
- the namespace declarations for this xpath expression.
AtomicStep.IllegalAccessException
- if method is called outside 'execute(String)'.
XPathException
- if an error occurred in preparing the XPath.public final XPathInXProcSequence compileXPath(String xpathExpression, String baseUri, com.xml_project.xom.XOMUtilities.NamespaceMap declaredNamespaces, nu.xom.Document[] sequence) throws AtomicStep.IllegalAccessException, XPathException
Prepares an XPath expression for a sequence evaluation
xpathExpression
- the XPath expression to be prepared for evaluation.baseUri
- the base uri for this evaluation.declaredNamespaces
- the namespace declaration for this expression.sequence
- the sequence of documents to be evaluated.
AtomicStep.IllegalAccessException
- if method is called outside 'execute(String)'.
XPathException
- if an error occurred in preparing the XPath.protected abstract void execute(String stepURI) throws com.xml_project.morganaxproc.core.XProcRuntimeException, com.xml_project.morganaxproc.core.StepException, AtomicStep.IllegalAccessException
This method must be implemented for the new step
stepURI
- the uri of this step
com.xml_project.morganaxproc.core.XProcRuntimeException
- if a dynamic error occurred
com.xml_project.morganaxproc.core.StepException
- if a step error (c:xxxx) occurred
AtomicStep.IllegalAccessException
- if your implementation tries to access a port or an option not declared
for this step.protected final nu.xom.Document getInputPortDocument(String portName) throws AtomicStep.IllegalAccessException
Returns the first document of the named port.
portName
- the port name
AtomicStep.IllegalAccessException
- if the port's name is not declared for this step.protected final nu.xom.Document[] getInputPortDocuments(String portName) throws AtomicStep.IllegalAccessException
Returns the documents of the named port.
portName
- the port name
AtomicStep.IllegalAccessException
- if the port's name is not declared for this step.protected final OptionValue getOptionValue(QName name) throws AtomicStep.IllegalAccessException
Returns the OptionValue of the named option.
name
- the option name.
AtomicStep.IllegalAccessException
- if the option's name is not declared for this step.protected final String getOptionValueAsString(QName name) throws AtomicStep.IllegalAccessException
Returns the value of the named option as String
name
- the option name
AtomicStep.IllegalAccessException
- if the option's name is not declared for this step.protected final void setOutputPortDocuments(String portName, nu.xom.Document[] documents) throws AtomicStep.IllegalAccessException
Puts a sequence of documents on the named port.
portName
- the port's namedocuments
- the documents to put on the port.
AtomicStep.IllegalAccessException
- if the port's name is not declared for this step.protected final void setOutputPortDocument(String portName, nu.xom.Document document) throws AtomicStep.IllegalAccessException
Puts a single document on the named port.
portName
- the ports namedocument
- the document to put on the port.
AtomicStep.IllegalAccessException
- if the port's name is not declared for this step.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |