Class EventPointer
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.pointer.EventPointer
-
public class EventPointer extends Object
Represents a pointer to an event and provides convenience methods to retrieve attribute values from the event.
A pointer captures the state of an execution in a point of time. Formally, a pointer is a pair of attributes:reference: key to an execution context value holding the event visit: name of the visit method that the event is targeting Pointer nodes are meant for nested Smooks executions (i.e., a Smooks execution within another Smooks execution). It allows the outer execution to carry over its visit state to the nested execution with the help of
EventPointerStaticProxyInterceptor. Without a pointer, the nested Smooks instance cannot join the inner execution to the outer one.
-
-
Constructor Summary
Constructors Constructor Description EventPointer(Document factory, VisitSequence visitSequence)EventPointer(Node node)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Nodedereference(org.smooks.api.ExecutionContext executionContext)Provides a convenience method to retrieve the source node.NodegetPointerNode()org.smooks.api.TypedKey<Node>getReference()Gets the execution context key which maps to the node representing the event.VisitSequencegetVisit()Gets the name of the visit thisEventPointeris targeting.static booleanisPointer(Node node)Checks whether a node is a pointer element.
-
-
-
Constructor Detail
-
EventPointer
public EventPointer(Node node)
-
EventPointer
public EventPointer(Document factory, VisitSequence visitSequence)
-
-
Method Detail
-
getPointerNode
public Node getPointerNode()
-
isPointer
public static boolean isPointer(Node node)
Checks whether a node is a pointer element.- Parameters:
node- the node to be tested- Returns:
trueif the node is a pointer otherwisefalse
-
getReference
public org.smooks.api.TypedKey<Node> getReference()
Gets the execution context key which maps to the node representing the event.- Returns:
- the key of the execution context entry that holds the event node
-
getVisit
public VisitSequence getVisit()
Gets the name of the visit thisEventPointeris targeting.- Returns:
- the name of the visit
-
dereference
public Node dereference(org.smooks.api.ExecutionContext executionContext)
Provides a convenience method to retrieve the source node.- Parameters:
executionContext- the execution context holding the source- Returns:
- the source node or
nullif not found
-
-