de.zeigermann.xml.simpleImporter
Class DefaultSimpleImportHandler

java.lang.Object
  |
  +--de.zeigermann.xml.simpleImporter.DefaultSimpleImportHandler
All Implemented Interfaces:
SimpleImportHandler

public class DefaultSimpleImportHandler
extends Object
implements SimpleImportHandler

Empty implementation for callback interface SimpleImportHandler for SimpleImporter. For lazy people - like me - who do not like to write empty method bodies.

Author:
Olli Z.

Constructor Summary
DefaultSimpleImportHandler()
           
 
Method Summary
 void cData(SimplePath path, String cdata)
          Is called back when the parser has found character data.
 void endDocument()
          Is called back when the parsed document ends.
 void endElement(SimplePath path, String name)
          Is called back when the parser has found the end of an element.
 void startDocument()
          Is called back when the parsed document begins.
 void startElement(SimplePath path, String name, AttributesImpl attributes, String leadingCDdata)
          Is called back when the parser has found the start of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSimpleImportHandler

public DefaultSimpleImportHandler()
Method Detail

startDocument

public void startDocument()
Description copied from interface: SimpleImportHandler
Is called back when the parsed document begins.

Specified by:
startDocument in interface SimpleImportHandler

endDocument

public void endDocument()
Description copied from interface: SimpleImportHandler
Is called back when the parsed document ends.

Specified by:
endDocument in interface SimpleImportHandler

cData

public void cData(SimplePath path,
                  String cdata)
Description copied from interface: SimpleImportHandler
Is called back when the parser has found character data.
Caution: This method will not be called when SimpleImporter#setIncludeLeadingCDataIntoStartElementCallback(boolean) is enabled. In this case character data will be passed over together with SimpleImportHandler.startElement(SimplePath, String, AttributesImpl, String).
Unlike the character method in the SAX interface this callback guarantees maximum length chunks of character data. This means, on a contiguous text block, i.e. text not intermitted by tagging, you will get exactly one callback.

Specified by:
cData in interface SimpleImportHandler
Parameters:
path - path of the element closed by this end tag
cdata - The character data (like in SAX, but unlike from the SimpleImportHandler.startElement(SimplePath, String, AttributesImpl, String) call a sequence of CDATA is not guaranteed to be grouped together into one callback) of this callbacks. If leading CDATA is delivered together with SimpleImportHandler.startElement(SimplePath, String, AttributesImpl, String) it will not be called back here.
See Also:
SimpleImportHandler.startElement(SimplePath, String, AttributesImpl, String)

startElement

public void startElement(SimplePath path,
                         String name,
                         AttributesImpl attributes,
                         String leadingCDdata)
Description copied from interface: SimpleImportHandler
Is called back when the parser has found the start of an element. This callback is especially convenient when your data does not have mixed content, i.e. the mixture of CDATA and tagging in one element level. When this is the case you will always get the whole text content together with this callback in the leadingCDdata parameter. Unlike from SimpleImportHandler.cData(SimplePath, String) callback all character data fragments will be grouped together in this parameter.
If you have to deal with mixed content you can still leave this feature enabled, but you will have to be aware of the fact that you will then get some character data via this callback and other via the SimpleImportHandler.cData(SimplePath, String) callback.

Specified by:
startElement in interface SimpleImportHandler
Parameters:
path - path of the element closed by this end tag
name - the name of the end tag
leadingCDdata - If enabled in SimpleImporter.setIncludeLeadingCDataIntoStartElementCallback(boolean) the text directly following the start tag, i.e. before any other tagging. If this is enabled you will not get this text via the SimpleImportHandler.cData(SimplePath, String) callback.

endElement

public void endElement(SimplePath path,
                       String name)
Description copied from interface: SimpleImportHandler
Is called back when the parser has found the end of an element.

Specified by:
endElement in interface SimpleImportHandler
Parameters:
path - path of the element closed by this end tag
name - the name of the element to be closed


Copyright 2002-2003 Oliver Zeigermann. All Rights Reserved.