Class Bridge
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.bridge.Bridge
-
public class Bridge extends Object
Represents a bridge node and provides convenience methods to retrieve attribute values from the node.
A bridge node holds the state of an execution. Formally, a bridge is a pair of attributes:source: key to an execution context value holding the event visit: name of the visit method that the event is targeting Bridge 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
BridgeInterceptor
. Without a bridge, the nested Smooks instance cannot join the inner execution to the outer one.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TypedKey<Node>
getSourceKey()
Gets the execution context key which maps to the node representing the event.Node
getSourceValue(ExecutionContext executionContext)
Provides a convenience method to retrieve the source node.String
getVisit()
Gets the name of the visit thisBridge
is targeting.static boolean
isBridge(Node node)
Checks whether a node is a bridge element.
-
-
-
Constructor Detail
-
Bridge
public Bridge(Node node)
-
-
Method Detail
-
isBridge
public static boolean isBridge(Node node)
Checks whether a node is a bridge element.- Parameters:
node
- the node to be tested- Returns:
true
if the node is a bridge otherwisefalse
-
getSourceKey
public TypedKey<Node> getSourceKey()
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 String getVisit()
Gets the name of the visit thisBridge
is targeting.- Returns:
- the name of the visit
-
getSourceValue
public Node getSourceValue(ExecutionContext executionContext)
Provides a convenience method to retrieve the source node.- Parameters:
executionContext
- the execution context holding the source- Returns:
- the source node or
null
if not found
-
-