com.sodius.mdw.core.util.io
Class XMLDefaultHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.sodius.mdw.core.util.io.XMLDefaultHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XMLDefaultHandler
extends DefaultHandler

Default base class for SAX2 event handlers.

This handler provides two features :

If you intent to provide an XML connector reader, you should consider to subclass this implementation.

Clients may subclass this class.

See Also:
ModelReader, XMLUtils.newParser()

Constructor Summary
XMLDefaultHandler()
           
 
Method Summary
 String intern(String value)
          Returns a canonical representation for the specified string object.
 InputSource resolveEntity(String publicId, String systemId)
          This implementation ignores external entities.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, 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

XMLDefaultHandler

public XMLDefaultHandler()
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException
This implementation ignores external entities. This will avoid to load the DTD referenced by the XMl document, and particulary avoid to get an exception if this DTD is not available.

Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DefaultHandler
Returns:
always returns an empty input source to ignore this external entity.
Throws:
SAXException

intern

public final String intern(String value)
Returns a canonical representation for the specified string object. This can help to reduce memory usage.

Note : the interned pool of strings is local to this handler. Once this handler is garbaged, the whole pool of strings is garbaged as well.

Parameters:
value - the string to intern.
Returns:
a string that has the same contents as this string, but is guaranteed to be from a pool of unique strings.
See Also:
String.intern()