public abstract class FlowElementBuilder extends Object
Constructor and Description |
---|
FlowElementBuilder() |
Modifier and Type | Method and Description |
---|---|
protected abstract FlowElementDescription |
build(List<PortInfo> inputPorts,
List<PortInfo> outputPorts,
List<DataInfo> arguments,
List<AttributeInfo> attributes)
Builds a flow from operator input/output/arguments.
|
static FlowElementBuilder |
createFlow(Class<? extends FlowDescription> flowDescriptionClass,
Class<?>... constructorParameterTypes)
Creates a new instance for flow description class.
|
static FlowElementBuilder |
createOperator(Class<? extends Annotation> annotationType,
Class<?> operatorClass,
Class<?> implementationClass,
String methodName,
Class<?>... methodParameterTypes)
Creates a new instance for operator method.
|
static FlowElementBuilder |
createOperator(Class<? extends Annotation> annotationType,
Class<?> operatorClass,
String methodName,
Class<?>... methodParameterTypes)
Creates a new instance for operator method.
|
void |
defineAttribute(Object attribute)
Defines an attribute.
|
DataInfo |
defineData(String name,
Data data)
Defines a new data for operator.
|
DataInfo |
defineData(String name,
Type type,
Object value)
Defines a new argument for operator.
|
PortInfo |
defineInput(String name,
Source<?> upstream)
Defines a new input for operator.
|
PortInfo |
defineInput(String name,
Source<?> upstream,
FlowElementAttribute... attributes)
Defines a new input for operator.
|
PortInfo |
defineOutput(String name,
Source<?> typeRef)
Defines a new output for operator.
|
PortInfo |
defineOutput(String name,
Source<?> typeRef,
FlowElementAttribute... attributes)
Defines a new output for operator.
|
PortInfo |
defineOutput(String name,
Type type)
Defines a new output for operator.
|
PortInfo |
defineOutput(String name,
Type type,
FlowElementAttribute... attributes)
Defines a new output for operator.
|
FlowElementEditor |
resolve()
Resolves current operator input/output/arguments.
|
public static FlowElementBuilder createOperator(Class<? extends Annotation> annotationType, Class<?> operatorClass, String methodName, Class<?>... methodParameterTypes)
annotationType
- operator annotation type.operatorClass
- operator classmethodName
- operator method namemethodParameterTypes
- the operator method parameter typesIllegalArgumentException
- if some parameters were null
public static FlowElementBuilder createOperator(Class<? extends Annotation> annotationType, Class<?> operatorClass, Class<?> implementationClass, String methodName, Class<?>... methodParameterTypes)
annotationType
- operator annotation type.operatorClass
- operator classimplementationClass
- operator implementation classmethodName
- operator method namemethodParameterTypes
- the operator method parameter typesIllegalArgumentException
- if some parameters were null
public static FlowElementBuilder createFlow(Class<? extends FlowDescription> flowDescriptionClass, Class<?>... constructorParameterTypes)
flowDescriptionClass
- flow description classconstructorParameterTypes
- constructor parameter typesIllegalArgumentException
- if some parameters were null
public PortInfo defineInput(String name, Source<?> upstream)
name
- input nameupstream
- upstream datasetIllegalArgumentException
- if some parameters were null
public PortInfo defineInput(String name, Source<?> upstream, FlowElementAttribute... attributes)
name
- input nameupstream
- upstream datasetattributes
- the port attributesIllegalArgumentException
- if some parameters were null
public PortInfo defineOutput(String name, Type type)
name
- output nametype
- output typeIllegalArgumentException
- if some parameters were null
public PortInfo defineOutput(String name, Source<?> typeRef)
name
- output nametypeRef
- output type referenceIllegalArgumentException
- if some parameters were null
public PortInfo defineOutput(String name, Type type, FlowElementAttribute... attributes)
name
- output nametype
- output typeattributes
- the port attributesIllegalArgumentException
- if some parameters were null
public PortInfo defineOutput(String name, Source<?> typeRef, FlowElementAttribute... attributes)
name
- output nametypeRef
- output type referenceattributes
- the port attributesIllegalArgumentException
- if some parameters were null
public DataInfo defineData(String name, Data data)
name
- the argument namedata
- data representationIllegalArgumentException
- if some parameters were null
public DataInfo defineData(String name, Type type, Object value)
name
- the argument nametype
- the value typevalue
- the constant valueIllegalArgumentException
- if some parameters were null
public void defineAttribute(Object attribute)
attribute
- the attributeIllegalArgumentException
- if some parameters were null
public FlowElementEditor resolve()
IllegalStateException
- if failed to resolve the operatorprotected abstract FlowElementDescription build(List<PortInfo> inputPorts, List<PortInfo> outputPorts, List<DataInfo> arguments, List<AttributeInfo> attributes)
inputPorts
- list of operator inputoutputPorts
- list of operator outputarguments
- list of operator argumentattributes
- list of operator attributeIllegalStateException
- if failed to resolve the operatorCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.