public abstract class Process extends java.lang.Object implements IOProcess
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_OUTPUT |
protected java.util.Map<java.lang.String,IParameter> |
inputs |
protected java.util.Map<java.lang.String,java.lang.Object> |
outputs |
| Constructor and Description |
|---|
Process() |
Process(java.util.Map<java.lang.String,Specification> inputSpecification) |
Process(java.util.Map<java.lang.String,Specification> inputSpecification,
java.util.Map<java.lang.String,Specification> outputSpecification) |
| Modifier and Type | Method and Description |
|---|---|
Process |
addInputSpecification(java.lang.String name,
Specification specification)
Add or replace an input specification as a parameter name and type.
|
Process |
addOutputSpecification(java.lang.String name,
Specification specification)
Add or replace an input specification as a parameter name and type.
|
java.util.Map<java.lang.String,java.lang.Object> |
checkInputs()
Helper to check that parameters are valid in the process method
|
java.util.List<ProcessException> |
getExceptions()
Get exceptions thrown during process.
|
IParameter |
getInput(java.lang.String name)
Get a parameter by name.
|
java.util.Map<java.lang.String,IParameter> |
getInputs() |
java.util.Map<java.lang.String,Specification> |
getInputSpecification()
Specification of input parameters. |
java.lang.Object |
getInputValue(java.lang.String name) |
java.lang.String |
getName() |
java.lang.Object |
getOutput(java.lang.String name)
Get an output parameter or thows an exception if this parameter does not exists.
|
java.util.Map<java.lang.String,Specification> |
getOutputSpecification()
Specification of output parameters. |
java.lang.Class |
getType() |
java.lang.Object |
getValue() |
abstract java.lang.Object |
process()
Processes input parameters and return an object of type getType().
|
Process |
setInput(java.lang.String name,
IParameter value)
Set an input parameter fo this process.
|
Process |
setInput(java.lang.String name,
java.lang.Object value)
Helper method wrapping any object in a constant implementing IParameter.
|
void |
setInputs(java.util.Map<java.lang.String,IParameter> parameters)
Set input values as a Map
|
void |
setName(java.lang.String name) |
java.lang.String |
toXml() |
public static java.lang.String DEFAULT_OUTPUT
protected java.util.Map<java.lang.String,IParameter> inputs
protected java.util.Map<java.lang.String,java.lang.Object> outputs
public Process()
public Process(java.util.Map<java.lang.String,Specification> inputSpecification)
public Process(java.util.Map<java.lang.String,Specification> inputSpecification, java.util.Map<java.lang.String,Specification> outputSpecification)
public java.lang.String getName()
public void setName(java.lang.String name)
public Process addInputSpecification(java.lang.String name, Specification specification)
name - name of the new parameterspecification - specification of the new parameterpublic Process addOutputSpecification(java.lang.String name, Specification specification)
name - name of the new parameterspecification - specification of the new parameterpublic java.util.Map<java.lang.String,Specification> getInputSpecification()
Specification of input parameters.getInputSpecification in interface IOProcesspublic java.util.Map<java.lang.String,Specification> getOutputSpecification()
Specification of output parameters.getOutputSpecification in interface IOProcesspublic Process setInput(java.lang.String name, java.lang.Object value) throws ProcessInputException
name - of the parameter to setvalue - ProcessInputException - if name is not a valid parameter of this processpublic Process setInput(java.lang.String name, IParameter value) throws ProcessInputException
setInput in interface IOProcessname - name of the parametervalue - value of the parameterProcessInputExceptionpublic IParameter getInput(java.lang.String name)
public java.lang.Object getInputValue(java.lang.String name)
throws ProcessInputException
ProcessInputExceptionpublic java.util.Map<java.lang.String,IParameter> getInputs()
public void setInputs(java.util.Map<java.lang.String,IParameter> parameters)
public java.util.Map<java.lang.String,java.lang.Object> checkInputs()
throws ProcessInputException
ProcessInputExceptionpublic abstract java.lang.Object process()
throws ProcessException
ProcessExceptionpublic java.lang.Class getType()
public java.lang.Object getOutput(java.lang.String name)
throws ProcessOutputException
getOutput in interface IOProcessname - the name of the parameter to retrieveProcessOutputException - if name is not defined for this Processpublic java.lang.Object getValue()
public java.util.List<ProcessException> getExceptions()
getExceptions in interface IOProcesspublic java.lang.String toXml()
throws XmlMappingException
XmlMappingException