Class XMLPropertyListConfiguration.XMLPropertyListHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.commons.configuration2.plist.XMLPropertyListConfiguration.XMLPropertyListHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
- Enclosing class:
- XMLPropertyListConfiguration
private final class XMLPropertyListConfiguration.XMLPropertyListHandler extends org.xml.sax.helpers.DefaultHandler
SAX Handler to build the configuration nodes while the document is being parsed.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringBuilder
buffer
The buffer containing the text node being readprivate XMLPropertyListConfiguration.PListNodeBuilder
resultBuilder
The builder for the resulting node.private java.util.List<XMLPropertyListConfiguration.PListNodeBuilder>
stack
The stack of configuration nodes
-
Constructor Summary
Constructors Constructor Description XMLPropertyListHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
XMLPropertyListConfiguration.PListNodeBuilder
getResultBuilder()
Gets the builder for the result node.private XMLPropertyListConfiguration.PListNodeBuilder
peek()
Return the node on the top of the stack.private XMLPropertyListConfiguration.PListNodeBuilder
peekNE()
Returns the node on top of the non-empty stack.private XMLPropertyListConfiguration.PListNodeBuilder
pop()
Remove and return the node on the top of the stack.private void
push(XMLPropertyListConfiguration.PListNodeBuilder node)
Put a node on the top of the stack.void
startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
-
-
-
Field Detail
-
buffer
private final java.lang.StringBuilder buffer
The buffer containing the text node being read
-
stack
private final java.util.List<XMLPropertyListConfiguration.PListNodeBuilder> stack
The stack of configuration nodes
-
resultBuilder
private final XMLPropertyListConfiguration.PListNodeBuilder resultBuilder
The builder for the resulting node.
-
-
Method Detail
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
getResultBuilder
public XMLPropertyListConfiguration.PListNodeBuilder getResultBuilder()
Gets the builder for the result node.- Returns:
- the result node builder
-
peek
private XMLPropertyListConfiguration.PListNodeBuilder peek()
Return the node on the top of the stack.
-
peekNE
private XMLPropertyListConfiguration.PListNodeBuilder peekNE()
Returns the node on top of the non-empty stack. Throws an exception if the stack is empty.- Returns:
- the top node of the stack
- Throws:
ConfigurationRuntimeException
- if the stack is empty
-
pop
private XMLPropertyListConfiguration.PListNodeBuilder pop()
Remove and return the node on the top of the stack.
-
push
private void push(XMLPropertyListConfiguration.PListNodeBuilder node)
Put a node on the top of the stack.
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
-