|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.pipeline.stage.BaseStage org.apache.commons.pipeline.stage.InvokeStaticMethodStage
public class InvokeStaticMethodStage
Runs a static method with the object (or array) being processed. The returned object
will be exqueued on the main pipeline if it is not null. If the returned
object is null, this stage will attempt to place the original object on the
branch specified by #setNullResultBranchTag(String)
.
Field Summary |
---|
Fields inherited from class org.apache.commons.pipeline.stage.BaseStage |
---|
context |
Constructor Summary | |
---|---|
InvokeStaticMethodStage(Method method)
Creates a new instance of InvokeStaticMethodStage |
|
InvokeStaticMethodStage(String className,
String methodName,
String... argumentTypeNames)
Convenience method to create the new stage with String description of className, methodName and argumentType |
Method Summary | |
---|---|
Method |
getMethod()
Returns the Method object for the method that will be used to process objects in the queue. |
String |
getNullResultBranchKey()
Getter for property nullResultBranchKey. |
void |
process(Object obj)
Calls the defined static method and exqueues the returned object if it is not null, otherwise placing the original object on the branch specified by the nullResultBranchKey property if nullResultBranchKey is not null. |
void |
setNullResultBranchKey(String nullResultBranchKey)
Setter for property nullResultBranchKey. |
Methods inherited from class org.apache.commons.pipeline.stage.BaseStage |
---|
emit, emit, init, postprocess, preprocess, release |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InvokeStaticMethodStage(Method method)
public InvokeStaticMethodStage(String className, String methodName, String... argumentTypeNames) throws ClassNotFoundException, NoSuchMethodException
className
- The fully qualified class name, such as "java.lang.String" of the class in which the method residesmethodName
- The name of the methodargumentType
- The argument type of the method (Sorry, this doesn't support multiple argument methods)
ClassNotFoundException
NoSuchMethodException
Method Detail |
---|
public Method getMethod()
public void process(Object obj) throws StageException
Calls the defined static method and exqueues the returned object if it is not null, otherwise placing the original object on the branch specified by the nullResultBranchKey property if nullResultBranchKey is not null.
process
in interface Stage
process
in class BaseStage
obj
- The object to be processed.
StageException
- an Exception thrown by an overriding implementation should
be wrapped in a StageException
public String getNullResultBranchKey()
public void setNullResultBranchKey(String nullResultBranchKey)
nullResultBranchKey
- New value of property nullResultBranchKey.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |