Class XmlSiteExportHandler
- java.lang.Object
 - 
- org.xml.sax.helpers.DefaultHandler
 - 
- com.atlassian.confluence.it.export.XmlSiteExportHandler
 
 
 
- 
- All Implemented Interfaces:
 ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class XmlSiteExportHandler extends DefaultHandler
A SAX handler for processing the XML component of a site export and building some simple mappings of the found pages and spaces, suitable for validating Site export tests. You should note that a large site export will lead to large memory usage so use it for small test sites only. It's also pretty quick and nasty but you'll see that for yourself. 
- 
- 
Constructor Summary
Constructors Constructor Description XmlSiteExportHandler() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Note that a SAX driver is free to chunk the character data any way it wants, so you cannot count on all of the character data content of an element arriving in a single characters event.voidendElement(String uri, String localName, String name)If this is the end of an object element and we have a current item then store it.SimpleSiteStructuregetStructure()When called after parsing is complete it will return theSimpleSiteStructurewhich has been constructed.voidstartDocument()voidstartElement(String uri, String localName, String name, Attributes attributes)Does not expect or handle nested object elements.- 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning 
 - 
 
 - 
 
- 
- 
Method Detail
- 
characters
public void characters(char[] ch, int start, int length) throws SAXExceptionNote that a SAX driver is free to chunk the character data any way it wants, so you cannot count on all of the character data content of an element arriving in a single characters event.- Specified by:
 charactersin interfaceContentHandler- Overrides:
 charactersin classDefaultHandler- Throws:
 SAXException
 
- 
endElement
public void endElement(String uri, String localName, String name) throws SAXException
If this is the end of an object element and we have a current item then store it. Nested object elements would confuse things.- Specified by:
 endElementin interfaceContentHandler- Overrides:
 endElementin classDefaultHandler- Throws:
 SAXException
 
- 
startDocument
public void startDocument() throws SAXException- Specified by:
 startDocumentin interfaceContentHandler- Overrides:
 startDocumentin classDefaultHandler- Throws:
 SAXException
 
- 
startElement
public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException
Does not expect or handle nested object elements. If one is encountered then any parsing of outer object will be lost.- Specified by:
 startElementin interfaceContentHandler- Overrides:
 startElementin classDefaultHandler- Throws:
 SAXException
 
- 
getStructure
public SimpleSiteStructure getStructure()
When called after parsing is complete it will return theSimpleSiteStructurewhich has been constructed.- Returns:
 - the structure created or null if parsing has not been performed.
 
 
 - 
 
 -