org.orbeon.oxf.processor
Interface Processor

All Known Implementing Classes:
ProcessorImpl, SimpleProcessor

public interface Processor

Base interface implemented by all processors.

See Also:
ProcessorImpl

Method Summary
 org.orbeon.oxf.processor.ProcessorInput createInput(String name)
          Creates a new input on this processor.
 org.orbeon.oxf.processor.ProcessorOutput createOutput(String name)
          Creates a new output on this processor.
 void deleteInput(org.orbeon.oxf.processor.ProcessorInput name)
          Deletes an input previously created with createInput(String name)
 void deleteOutput(org.orbeon.oxf.processor.ProcessorOutput output)
          Deletes an output previously created with createOutput(String name)
 Map getConnectedInputs()
           
 Map getConnectedOutputs()
           
 String getId()
          A processor may have an "identifier".
 org.orbeon.oxf.processor.ProcessorInput getInputByName(String name)
           
 List getInputsInfo()
           
 LocationData getLocationData()
          When this processor is created based on a declaration in an XML document, the LocationData provides information about the location of this declaration.
 org.dom4j.QName getName()
          Name of the processor, if it has been created by a factory and that factory has a name.
 org.orbeon.oxf.processor.ProcessorOutput getOutputByName(String name)
           
 List getOutputsInfo()
           
 void reset(PipelineContext context)
          Resets the processor.
 void setId(String id)
           
 void setLocationData(LocationData locationData)
           
 void setName(org.dom4j.QName name)
           
 void start(PipelineContext context)
          This method is called to trigger the execution of this processor.
 

Method Detail

getId

String getId()
A processor may have an "identifier". The identifier has no implication on the behaviour of the processor. It is there for information only (for instance, it will be displayed by the Inspector). In the pipeline language, the id is specified with the "id" attribute of the element.

Returns:
the identifier of this processor

setId

void setId(String id)
Parameters:
id - the new id of this processor
See Also:
getId()

getLocationData

LocationData getLocationData()
When this processor is created based on a declaration in an XML document, the LocationData provides information about the location of this declaration. Typically, if this processor corresponds to a a PDL file, the LocationData holds information regarding the position of the element in the PDL file.

Returns:
the LocationData for this processor

setLocationData

void setLocationData(LocationData locationData)
Parameters:
locationData - the new LocationData of this processor
See Also:
getLocationData()

getName

org.dom4j.QName getName()
Name of the processor, if it has been created by a factory and that factory has a name. The name has no implication on the behaviour of the processor. It is there for information only.

Returns:
The name of this processor

setName

void setName(org.dom4j.QName name)
Parameters:
name - The new name of this processor
See Also:
getName()

createInput

org.orbeon.oxf.processor.ProcessorInput createInput(String name)
Creates a new input on this processor. The new input can then be connected to the output of an other processor. This method cannot be called twice with the same name on the same processor.

Parameters:
name - Name of the input to create
Returns:
The newly created input

deleteInput

void deleteInput(org.orbeon.oxf.processor.ProcessorInput name)
Deletes an input previously created with createInput(String name)

Parameters:
name - Name of the input to delete
See Also:
createInput(java.lang.String)

getInputByName

org.orbeon.oxf.processor.ProcessorInput getInputByName(String name)
Parameters:
name - Name of the input
Returns:
The inputs that have been previously created with createInput(String name). Returns null if there is no existing input with this name.
See Also:
createInput(java.lang.String)

createOutput

org.orbeon.oxf.processor.ProcessorOutput createOutput(String name)
Creates a new output on this processor. The output can then be connected to the input of an other processor. This method cannnot be called twice on the same processor with the same name.

Parameters:
name - Name of the output to create. null is allowed.
Returns:
The newly created output

deleteOutput

void deleteOutput(org.orbeon.oxf.processor.ProcessorOutput output)
Deletes an output previously created with createOutput(String name)

Parameters:
output - Name of the output to delete
See Also:
createOutput(java.lang.String)

getOutputByName

org.orbeon.oxf.processor.ProcessorOutput getOutputByName(String name)
Parameters:
name - Name of the output
Returns:
The outputs that have been previously created with createOutput(String name). Returns null if there is no existing output with this name.
See Also:
createOutput(java.lang.String)

getInputsInfo

List getInputsInfo()
Returns:
A list of ProcessorInputOutputInfo objects corresponding to the inputs that can be created on this processor. This exposes the "input API" of this processor.

getOutputsInfo

List getOutputsInfo()
Returns:
A list of ProcessorInputOutputInfo objects corresponding to the outputs that can be created on this processor. This exposes the "outputs API" of this processor.

getConnectedInputs

Map getConnectedInputs()
Returns:
A read-only Map containing all the inputs currently connected to this processor. Each key in the Map is a String specifying an input name. The List associated to the key contains one or more ProcessorInput objects. This is particularly useful to detect whether optional inputs are connected.

getConnectedOutputs

Map getConnectedOutputs()
Returns:
A read-only Map containing all the outputs currently connected to this processor. Each key in the Map is a String specifying an output name. The List associated to the key contains one or more ProcessorOutput objects. This is particularly useful to detect whether optional outputs are connected.

start

void start(PipelineContext context)
This method is called to trigger the execution of this processor. This method can only be called on processor with no outputs (so-called serializers). If this processor has outputs, the method read should be called on the outputs instead.

Parameters:
context - Context in which the processor is executed

reset

void reset(PipelineContext context)
Resets the processor. This method is called before the processor is executed (either by calling read its outputs, or by calling start on the processor.

Parameters:
context - Context in which the processor is executed