- java.lang.Object
-
- com.pervasive.datarush.script.OperatorDescriptor
-
public class OperatorDescriptor extends Object
Captures the definition of an operator.
-
-
Constructor Summary
Constructors Constructor Description OperatorDescriptor(Class<? extends LogicalOperator> opClass)
Construct an operator definition with the default name of the operator.OperatorDescriptor(Class<? extends LogicalOperator> opClass, String opName)
Construct an operator descriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LogicalOperator
createInstance()
Create an instance of the operator.String
getDescription()
Get the description of the operator.int
getInputPortCount()
Get the number of input ports defined by the operator.List<PortDescriptor>
getInputPortDescriptors()
Get the port definitions of the input ports.Class<? extends LogicalOperator>
getOpClass()
Get the class of the operator.String
getOpName()
Get the logical name of the operator.int
getOutputPortCount()
Get the number of output ports defined by the operator.List<PortDescriptor>
getOutputPortDescriptors()
Get the port definitions of the output ports.List<PropertyDescriptor>
getProperties()
String[]
getPropertyNames()
Get the names of properties that can be set on the operator.static List<OperatorDescriptor>
loadDescriptions()
Load operator descriptors from registered classes.String
toString()
-
-
-
Constructor Detail
-
OperatorDescriptor
public OperatorDescriptor(Class<? extends LogicalOperator> opClass, String opName) throws Exception
Construct an operator descriptor.- Parameters:
opClass
- class implementing the operatoropName
- logical name of the operator- Throws:
Exception
- thrown if the operator cannot be instantiated
-
OperatorDescriptor
public OperatorDescriptor(Class<? extends LogicalOperator> opClass) throws Exception
Construct an operator definition with the default name of the operator. The default name is derived from the annotationJsonTypeName
.- Parameters:
opClass
- class implementing the operator- Throws:
Exception
- thrown if the operator cannot be instantiated
-
-
Method Detail
-
loadDescriptions
public static List<OperatorDescriptor> loadDescriptions()
Load operator descriptors from registered classes.- Returns:
- list of newly constructed operator descriptors
-
getPropertyNames
public String[] getPropertyNames()
Get the names of properties that can be set on the operator. The names are derived from public setter methods.- Returns:
- list of property names
-
getProperties
public List<PropertyDescriptor> getProperties()
-
getOpName
public String getOpName()
Get the logical name of the operator.- Returns:
-
getDescription
public String getDescription()
Get the description of the operator. This is derived from theOperatorDescription
annotation if it is available. Otherwise a description is generated.- Returns:
- operator description
-
getOpClass
public Class<? extends LogicalOperator> getOpClass()
Get the class of the operator.- Returns:
- operator class
-
getInputPortCount
public int getInputPortCount()
Get the number of input ports defined by the operator.- Returns:
- input port count
-
getInputPortDescriptors
public List<PortDescriptor> getInputPortDescriptors()
Get the port definitions of the input ports.- Returns:
- definitions of input ports
-
getOutputPortCount
public int getOutputPortCount()
Get the number of output ports defined by the operator.- Returns:
- output port count
-
getOutputPortDescriptors
public List<PortDescriptor> getOutputPortDescriptors()
Get the port definitions of the output ports.- Returns:
- output port definitions
-
createInstance
public LogicalOperator createInstance() throws Exception
Create an instance of the operator.- Returns:
- a new operator instance
- Throws:
Exception
- thrown if an error occurs instantiating the operator instance
-
-