com.ibm.streams.operator.model
Annotation Type DefaultAttribute
-
@Target(value=METHOD) @Retention(value=RUNTIME) @Documented public @interface DefaultAttribute
Declare a default attribute to be used as the value for an optional 'Attribute' parameter.The name of the attribute to be used as the default must be specified as the value of the annotation. If an attribute by the specified name exists in more than one input port's schema then the matching attribute in the first such port will be used as the parameter value.
This annotation must be used in conjunction with thecom.ibm.streams.operator.model.Parameter
annotation on a setter method of a Java bean of typecom.ibm.streams.operator.TupleAttribute
. For example, to specify that the 'jsonAttribute' optional parameter will pick up the 'jsonString' attribute from the stream by default (unless specified otherwise), you would specify the following:
@Parameter @DefaultAttribute("jsonString") public void setJsonAttribute(TupleAttribute
ta) {...}
When theDefaultAttribute
parameter is used for the parameter, the parameter defaults to be being optional and having a cardinality of 1.- Since:
- InfoSphere® Streams Version 4.0
- See Also:
Parameter
,TupleAttribute
-
-
Required Element Summary
Required Elements Modifier and Type Required Element and Description java.lang.String
value
Name of the attribute to be used as the default
-