net.sf.swan.xml.input.pattern
Class Connector
java.lang.Object
|
+--net.sf.swan.xml.input.pattern.Connector
- Direct Known Subclasses:
- Rule, Stereotype
- public abstract class Connector
- extends java.lang.Object
A component that aggregates a set of Rules
that should be evaluated
against some class of ContextEvents
.
When a Connector
is associated with an
EventContext
in some fashion during processing,
it's associated set of rules will be evaluated against descendant
ContextEvents
. When a descendant
event matches the pattern associated with a Rule
, the
handler
associated with the
rule will be invoked. A descendant event matches a rule's pattern if the event
would be a member of the result of evaluating the pattern as an expression with
respect to the Connector's
associated
EventContext
.
ContextListeners
invoked by a
rule in this fashion will have access to the
current context
for the event and the
source context
associated with the Connector
as event parameters (and can therefore
be implemented as binary operators acting upon the two contexts, if desired).
Method Summary |
Rule |
connect(java.lang.String pattern,
ContextListener handler)
Define a rule by specifying an XSLT-like pattern |
java.lang.String |
getLabel()
Returns the label associated with the componet. |
void |
setLabel(java.lang.String label)
Associates an arbitrary label with the component that is emitted
in the component's toString() method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getLabel
public java.lang.String getLabel()
- Returns the label associated with the componet.
- See Also:
setLabel(java.lang.String)
setLabel
public void setLabel(java.lang.String label)
- Associates an arbitrary label with the component that is emitted
in the component's
toString()
method. This is intended
primarily to facilitate tracing. However, client applications may
also use the label for their own purpose (such as using it as a key
to associate component's with other resources).
connect
public Rule connect(java.lang.String pattern,
ContextListener handler)
throws org.saxpath.SAXPathException
- Define a rule by specifying an XSLT-like pattern