org.apache.commons.xmlio.in
Interface SimpleImportHandler

All Known Implementing Classes:
DefaultSimpleImportHandler

public interface SimpleImportHandler

Callback interface for SimpleImporter.


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.
 

Method Detail

startDocument

void startDocument()
Is called back when the parsed document begins.


endDocument

void endDocument()
Is called back when the parsed document ends.


cData

void cData(SimplePath path,
           String cdata)
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 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.

Parameters:
path - path of the element closed by this end tag
cdata - The character data (like in SAX, but unlike from the 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 startElement(SimplePath, String, AttributesImpl, String) it will not be called back here.
See Also:
startElement(SimplePath, String, AttributesImpl, String)

startElement

void startElement(SimplePath path,
                  String name,
                  AttributesImpl attributes,
                  String leadingCDdata)
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 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 cData(SimplePath, String) callback.

Parameters:
path - path of the element closed by this end tag
name - the name of the start tag
attributes - SAX attributes associated to this element
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 cData(SimplePath, String) callback.

endElement

void endElement(SimplePath path,
                String name)
Is called back when the parser has found the end of an element.

Parameters:
path - path of the element closed by this end tag
name - the name of the element to be closed


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.