edu.mit.jverbnet.util.parse
Class CDataHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by edu.mit.jverbnet.util.parse.MappedHandler<java.lang.String>
          extended by edu.mit.jverbnet.util.parse.CDataHandler
All Implemented Interfaces:
IHasParserHandler, ITaggedBlockTaskHandler, ITaggedHandler<java.lang.String>, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class CDataHandler
extends MappedHandler<java.lang.String>

A handler that transforms CDATA into a String.

Since:
JVerbnet 1.0.0
Version:
1.2.0
Author:
Mark A. Finlayson

Field Summary
 
Fields inherited from class edu.mit.jverbnet.util.parse.MappedHandler
messageIgnoringElementBlockExternal, messageMatcherIgnoreExternal, messageMatcherIgnoreInternal, messageParserNotSet, messageUnmappedElementBlockInternal, tagStack
 
Constructor Summary
CDataHandler(IHasParserHandler parent, java.lang.String tag)
          Creates a new CDATA handler with the specified parser, parent and tag.
CDataHandler(java.lang.String tag)
          Creates a new CDATA handler with the specified tag.
CDataHandler(org.xml.sax.XMLReader parser, org.xml.sax.ContentHandler parent, java.lang.String tag)
          Creates a new CDATA handler with the specified parser, parent and tag.
CDataHandler(org.xml.sax.XMLReader parser, java.lang.String tag)
          Creates a new CDATA handler with the specified parser, parent and tag.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
protected  void clearLocal()
          Subclasses may override this method to add code to be invoked when MappedHandler.clear() is called.
 java.lang.String doGetElement()
          If subclasses intend to use the MappedHandler.getElement() method, they should override this method to provide the code that constructs the object corresponding to the tagged block.
 
Methods inherited from class edu.mit.jverbnet.util.parse.MappedHandler
checkParserSet, clear, endElement, endTaggedBlock, getDocumentLocator, getElement, getHandlerMappings, getParent, getParser, getTag, getTaggedBlockTasks, handleUnmappedEndElement, handleUnmappedStartElement, initHandlerMap, isInsideTaggedBlock, reportWarning, reportWarnings, setDocumentLocator, setParent, setParser, setReportWarnings, startElement, startTaggedBlock
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping
 

Constructor Detail

CDataHandler

public CDataHandler(java.lang.String tag)
Creates a new CDATA handler with the specified tag.

Parameters:
tag - the tag for the block that this handler handles; may not be null, empty, or all whitespace.
Throws:
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace
Since:
JVerbnet 1.0.0

CDataHandler

public CDataHandler(org.xml.sax.XMLReader parser,
                    java.lang.String tag)
Creates a new CDATA handler with the specified parser, parent and tag.

Parameters:
parser - the parser for this handler; may be null
tag - the tag for the block that this handler handles; may not be null, empty, or all whitespace.
Throws:
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace
Since:
JVerbnet 1.0.0

CDataHandler

public CDataHandler(IHasParserHandler parent,
                    java.lang.String tag)
Creates a new CDATA handler with the specified parser, parent and tag.

Parameters:
parent - this handler's parent; may be null
tag - the tag for the block that this handler handles; may not be null, empty, or all whitespace.
Throws:
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace
Since:
JVerbnet 1.0.0

CDataHandler

public CDataHandler(org.xml.sax.XMLReader parser,
                    org.xml.sax.ContentHandler parent,
                    java.lang.String tag)
Creates a new CDATA handler with the specified parser, parent and tag.

Parameters:
parser - the parser for this handler; may be null
parent - this handler's parent; may be null
tag - the tag for the block that this handler handles; may not be null, empty, or all whitespace.
Throws:
java.lang.NullPointerException - if the specified tag is null
java.lang.IllegalArgumentException - if the specified tag is empty or all whitespace
Since:
JVerbnet 1.0.0
Method Detail

clearLocal

protected void clearLocal()
Description copied from class: MappedHandler
Subclasses may override this method to add code to be invoked when MappedHandler.clear() is called.

Overrides:
clearLocal in class MappedHandler<java.lang.String>

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

doGetElement

public java.lang.String doGetElement()
Description copied from class: MappedHandler
If subclasses intend to use the MappedHandler.getElement() method, they should override this method to provide the code that constructs the object corresponding to the tagged block.

Overrides:
doGetElement in class MappedHandler<java.lang.String>
Returns:
the object corresponding to the tagged block


Copyright © 2012 ${project.organization.name}. All Rights Reserved.