org.apache.maven
Class XPathLocationTracker

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by org.apache.maven.XPathLocationTracker
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, XMLFilter, XMLReader

public class XPathLocationTracker
extends XMLFilterImpl

Constructs an XPath expression in the form: /root/child[3]/grandchild[2] ...

Author:
Lukas Theussl

Constructor Summary
XPathLocationTracker()
           
 
Method Summary
 void endDocument()
          Overriding ContentHandler.
 void endElement(String uri, String localName, String qName)
          Overriding ContentHandler.
 String getXPath()
          Gets the XPath expression that points to the current location.
 void startDocument()
          Overriding ContentHandler.
 void startElement(String uri, String localName, String qName, Attributes atts)
          Overriding ContentHandler.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathLocationTracker

public XPathLocationTracker()
Method Detail

startDocument

public void startDocument()
                   throws SAXException
Overriding ContentHandler.

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class XMLFilterImpl
Throws:
SAXException - SAXException

endDocument

public void endDocument()
                 throws SAXException
Overriding ContentHandler.

Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class XMLFilterImpl
Throws:
SAXException - SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Overriding ContentHandler.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class XMLFilterImpl
Parameters:
uri - uri
localName - localName
qName - qName
atts - atts
Throws:
SAXException - SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Overriding ContentHandler.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class XMLFilterImpl
Parameters:
uri - uri
localName - localName
qName - qName
Throws:
SAXException - SAXException

getXPath

public final String getXPath()
Gets the XPath expression that points to the current location. Throws a new IllegalStateException if the component is not parsing a document.

Returns:
The XPath expression


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.