asia.redact.bracket.properties
Class BracketPropertiesSAXHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by asia.redact.bracket.properties.BracketPropertiesSAXHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

 class BracketPropertiesSAXHandler
extends org.xml.sax.helpers.DefaultHandler

 Implement a SAXParser handler to consume the SAX events and turn that into a Properties file.
  It would be cleaner to use Dom4J or something like that, but I wanted to
 avoid additional dependencies where I could.

Author:
Dave

Field Summary
(package private)  boolean commentOn
           
(package private)  List<String> comments
           
(package private)  int count
           
(package private)  StringBuffer keyBuf
           
(package private)  Stack<String> keyStack
           
(package private)  Properties props
           
(package private)  String separator
           
(package private)  boolean separatorOn
           
(package private)  boolean valueOn
           
(package private)  List<String> values
           
 
Constructor Summary
BracketPropertiesSAXHandler()
           
 
Method Summary
 void characters(char[] buffer, int start, int length)
           
 void endElement(String uri, String localName, String qName)
           
 Properties getResult()
           
 void startElement(String uri, String localName, String qName, Attributes attributes)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

props

Properties props

count

int count

keyBuf

StringBuffer keyBuf

keyStack

Stack<String> keyStack

comments

List<String> comments

separator

String separator

values

List<String> values

commentOn

boolean commentOn

separatorOn

boolean separatorOn

valueOn

boolean valueOn
Constructor Detail

BracketPropertiesSAXHandler

public BracketPropertiesSAXHandler()
Method Detail

getResult

public Properties getResult()

characters

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

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
SAXException


Copyright © 2011-2013 David R. Smith. All Rights Reserved.