org.qedeq.kernel.xml.handler.common
Class SimpleHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.qedeq.kernel.xml.handler.common.SimpleHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Direct Known Subclasses:
SaxDefaultHandler, XPathLocationParser

public class SimpleHandler
extends org.xml.sax.helpers.DefaultHandler

SAX handler that remembers Locator and possibly encoding of XML document.

Author:
Michael Meyling

Constructor Summary
SimpleHandler()
          Constructor.
 
Method Summary
 java.lang.String getEncoding()
          Which encoding was used to parse the document?
protected  org.xml.sax.Locator getLocator()
          Get document locator.
 java.lang.String getUrl()
          Get original file URL.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Receive a Locator object for document events.
 void setUrl(java.lang.String url)
          Set original file URL.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleHandler

public SimpleHandler()
Constructor.

Method Detail

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Receive a Locator object for document events. Store the locator for use with other document events.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class org.xml.sax.helpers.DefaultHandler
Parameters:
locator - A locator for all SAX document events.
See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator), Locator

getEncoding

public java.lang.String getEncoding()
Which encoding was used to parse the document?

Returns:
Encoding for parsed document. Maybe null.

getLocator

protected org.xml.sax.Locator getLocator()
Get document locator. This value set is set during parsing.

Returns:
Locator. Maybe null.

setUrl

public final void setUrl(java.lang.String url)
Set original file URL.

Parameters:
url - Data from this source is parsed. This URL is only for information. The actual parsed data might be a local copy.

getUrl

public final java.lang.String getUrl()
Get original file URL.

Returns:
Data from this source is parsed. This URL is only for information. The actual parsed data might be a local copy.


Copyright © 2014. All Rights Reserved.