public class MethodCallingVisitor extends TraversalCheckingVisitor implements Serializable
AbstractPicoVisitor.PicoVisitorTraversalException
ABORT_TRAVERSAL, CONTINUE_TRAVERSAL
Constructor and Description |
---|
MethodCallingVisitor(Method method,
Class<?> ofType,
Object[] arguments,
boolean visitInInstantiationOrder)
Construct a MethodCallingVisitor for a method with arguments.
|
MethodCallingVisitor(Method method,
Class ofType,
Object[] arguments)
Construct a MethodCallingVisitor for standard methods visiting the component in instantiation order.
|
Modifier and Type | Method and Description |
---|---|
protected Object[] |
getArguments() |
protected Method |
getMethod() |
protected Class<Void> |
invoke(Object target) |
protected void |
invoke(Object[] targets) |
Object |
traverse(Object node)
Entry point for the PicoVisitor traversal.
|
boolean |
visitContainer(PicoContainer pico)
Visit a
PicoContainer that has to accept the visitor. |
visitComponentAdapter, visitComponentFactory, visitParameter
checkTraversal
public MethodCallingVisitor(Method method, Class<?> ofType, Object[] arguments, boolean visitInInstantiationOrder)
method
- the Method
to invokeofType
- the type of the components, that will be invokedvisitInInstantiationOrder
- true
if components are visited in instantiation orderarguments
- the arguments for the method invocation (may be null
)NullPointerException
- if method, or ofType is null
public MethodCallingVisitor(Method method, Class ofType, Object[] arguments)
method
- the method to invokeofType
- the type of the components, that will be invokedarguments
- the arguments for the method invocation (may be null
)NullPointerException
- if method, or ofType is null
public Object traverse(Object node)
PicoVisitor
PicoContainer
, ComponentAdapter
,
or Parameter
are valid.traverse
in interface PicoVisitor
traverse
in class AbstractPicoVisitor
node
- the start node of the traversal.public boolean visitContainer(PicoContainer pico)
TraversalCheckingVisitor
PicoContainer
that has to accept the visitor.visitContainer
in interface PicoVisitor
visitContainer
in class TraversalCheckingVisitor
pico
- the visited container.protected Object[] getArguments()
Copyright © 2003–2016 Codehaus. All rights reserved.