com.xml_project.morganaxproc
Class XProcInput

java.lang.Object
  extended by com.xml_project.morganaxproc.XProcInput

public class XProcInput
extends java.lang.Object

The class holds the document(s) to connect with the input port(s) of an XProc pipeline as well as the setting for options and for parameters.

To connect a document with an input port, just call addInput with the name of the port an the XProcSource holding the document (or the uri for the document) as parameters. If you need to connect a sequence of documents to a (sequence) input port, you can either call addInput() for each document to appear on the specific port, or you can call addInput() with a source array as parameter.


Constructor Summary
XProcInput()
           Create a new XProcInput
 
Method Summary
 void addInput(java.lang.String portName, XProcSource source)
           Connects the document an the XProcSource with the pipeline's input port.
 void addInput(java.lang.String portName, XProcSource[] sources)
           Connect the sequence of XProcSources with the pipeline's input port.
 void setOption(javax.xml.namespace.QName optionName, java.lang.String optionValue)
           Sets the value of the named option to the given value.
 void setOption(java.lang.String optionName, java.lang.String optionValue)
           Sets the value of the named option to the given value.
 void setParameter(java.lang.String portName, java.lang.String parName, java.lang.String namespace, java.lang.String parValue)
           Sets the value of the named parameter to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XProcInput

public XProcInput()

Create a new XProcInput

Method Detail

addInput

public void addInput(java.lang.String portName,
                     XProcSource source)
              throws XProcInterfaceException

Connects the document an the XProcSource with the pipeline's input port. If you use the same portName in more than one call of addInput the documents are added in the order of call to form an sequence of input documents for this port.

Parameters:
portName - the name an input port.
source - the document (or the uri to the document) to connect to the port.
Throws:
XProcInterfaceException - if portName is null or source is null.

addInput

public void addInput(java.lang.String portName,
                     XProcSource[] sources)
              throws XProcInterfaceException

Connect the sequence of XProcSources with the pipeline's input port. If you use the same portName in more than one call of addInput the document sequences are connected to form one sequence in the order of call.

Parameters:
portName - the name of an input port.
sources - an array with the documents (or uris to document) to connect to the port.
Throws:
XProcInterfaceException - if portName is null or an empty string or if source is null.

setOption

public void setOption(javax.xml.namespace.QName optionName,
                      java.lang.String optionValue)
               throws XProcInterfaceException

Sets the value of the named option to the given value. If you use the same option name in more than once call of setOption the previous set value is replaced.

Parameters:
optionName - the name of the option to set.
optionValue - the value for the option.
Throws:
XProcInterfaceException - if the optionName or the optionValue is null

setOption

public void setOption(java.lang.String optionName,
                      java.lang.String optionValue)
               throws XProcInterfaceException

Sets the value of the named option to the given value. The option name is treated as a QName with namespace uri and prefix set to "". If you use the same option name in more than once call of setOption the previous set value is replaced.

Parameters:
optionName - the name of the option to set.
optionValue - the value for the option.
Throws:
XProcInterfaceException - if optionName is null, an empty string or contains ":" or if optionValue is null.

setParameter

public void setParameter(java.lang.String portName,
                         java.lang.String parName,
                         java.lang.String namespace,
                         java.lang.String parValue)
                  throws XProcInterfaceException

Sets the value of the named parameter to the given value. Technically a c:param element is constructed with the name attribute set to parName, the namespace attribute (if non null) set to namespace and the value attribute set to parValue. This element is wrapped with a c:param-set element and added as a document to the sequence of the given port name. See: http://www.w3.org/TR/xproc/#cv.param for a detailed description.

Parameters:
portName - the name of the the parameter port on which the parameter should appear.
parName - the name of the parameter to set. Must have the lexical form of a QName, i.e. may have a prefix.
namespace - the namespace for this parameter or null, if the parameter if the namespace declarations in-scope should be used or if the parameter should be in no namespace.
parValue - the value for the parameter.
Throws:
XProcInterfaceException - if the portName or the parName is null or an empty string, or if the parValue is null.