net.sf.swan.xml.input.components
Class Annotator
java.lang.Object
|
+--net.sf.swan.xml.input.event.ContextAdapter
|
+--net.sf.swan.xml.input.components.Annotator
- All Implemented Interfaces:
- ContextListener
- public class Annotator
- extends ContextAdapter
Utility that can annotate ElementContext
objects with arbitary properties based on matching patterns. This is most useful
when used in conjunction with the StartElementFilters
class. Note that this
does not consume the events it is passed.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Annotator
public Annotator()
putNamespace
public void putNamespace(java.lang.String prefix,
java.lang.String uri)
getXPathSupport
public XPathSupport getXPathSupport()
match
public java.util.Map match(java.lang.String pattern)
throws org.saxpath.SAXPathException
- Specifies a pattern to match.
- Returns:
- a Map that may be used to add annotations that
will be later added to matching elements
startElement
public void startElement(StartElementEvent event)
throws EventContextException
- Overrides:
startElement
in class ContextAdapter