com.agimatec.commons.config.sax
Class ConfigContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.agimatec.commons.config.sax.ConfigContentHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Direct Known Subclasses:
ConfigWriter

public class ConfigContentHandler
extends DefaultHandler

Title: Description:

Author:
Roman Stumm

Field Summary
protected  Map elementMap
           
protected  ConfigManager myConfigManager
           
 
Constructor Summary
ConfigContentHandler(ConfigManager aConfigManager)
           
 
Method Summary
protected  void acceptNode(NodeHandler handler, Object aNode, Attributes attr)
           
 void addHandler(NodeHandler handler)
           
 void characters(char[] chars, int offset, int length)
           
 void endDocument()
           
 void endElement(String uri, String elementName, String qName)
           
 Config getConfig()
           
protected  NodeHandler getCurrentHandler()
           
protected  Object getCurrentNode()
           
protected  void initElementMap()
          add default NodeHandlers for config xml
 NodeHandler removeHandler(String tag)
           
 void startDocument()
           
 void startElement(String namespaceURI, String elementName, String qName, Attributes attr)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementMap

protected Map elementMap

myConfigManager

protected ConfigManager myConfigManager
Constructor Detail

ConfigContentHandler

public ConfigContentHandler(ConfigManager aConfigManager)
Method Detail

characters

public void characters(char[] chars,
                       int offset,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String elementName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
SAXException

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
Throws:
SAXException

initElementMap

protected final void initElementMap()
add default NodeHandlers for config xml


addHandler

public void addHandler(NodeHandler handler)

removeHandler

public NodeHandler removeHandler(String tag)

startElement

public void startElement(String namespaceURI,
                         String elementName,
                         String qName,
                         Attributes attr)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

getConfig

public Config getConfig()

acceptNode

protected void acceptNode(NodeHandler handler,
                          Object aNode,
                          Attributes attr)
                   throws SAXException
Throws:
SAXException

getCurrentHandler

protected NodeHandler getCurrentHandler()

getCurrentNode

protected Object getCurrentNode()


Copyright © 2008-2012. All Rights Reserved.