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.


Constructor Summary
Annotator()
           
 
Method Summary
 XPathSupport getXPathSupport()
           
 java.util.Map match(java.lang.String pattern)
          Specifies a pattern to match.
 void putNamespace(java.lang.String prefix, java.lang.String uri)
           
 void startElement(StartElementEvent event)
           
 
Methods inherited from class net.sf.swan.xml.input.event.ContextAdapter
endElement, getErrorHandler, processingInstruction, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Annotator

public Annotator()
Method Detail

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