More information


de.spieleck.config
Class Config

java.lang.Object
  |
  +--de.spieleck.config.Config

public class Config
extends java.lang.Object

Parser and builder for the "easy" XML based configuration classes.


Inner Class Summary
protected static class Config.ConfigSaxHandler
          Subclass to handle parser events
 
Field Summary
protected static ConfigFileNode defaultConfig
           
static java.lang.String INC_DIR
           
static java.lang.String INC_EXCL
           
static java.lang.String INC_HREF
           
static java.lang.String INC_LIST
           
static java.lang.String INC_PATH
           
static java.lang.String INC_SEP
           
static java.lang.String INCLUDEELEM
           
protected static java.util.List listeners
           
static java.lang.String NAME_ATTR
           
static java.lang.String PARAMELEM
           
static java.lang.String SETUPEXTENSION
           
protected static javax.xml.parsers.SAXParserFactory spf
          Hold a SaxParserFactory to instantiate parsers only
static char TEXTSEPARATOR
           
static java.lang.String THISATTR
           
static java.lang.String VALUE_ATTR
           
 
Method Summary
static void addListener(ConfigListener listener)
          We supply a preliminary api to inform listeners about a change in configuration.
static ConfigNode getConfig()
           
protected static void handleChange(ConfigNode s)
           
protected static javax.xml.parsers.SAXParser newSAXParser()
          obtain a new parser
static ConfigFileNode parse(org.xml.sax.InputSource is)
          Parse setup tree from an InputSource
static ConfigFileNode parse(org.xml.sax.InputSource is, ConfigParamMap pm)
           
static void removeListener(ConfigListener listener)
           
static ConfigNode setConfig(ConfigFileNode setup)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INCLUDEELEM

public static final java.lang.String INCLUDEELEM

PARAMELEM

public static final java.lang.String PARAMELEM

THISATTR

public static final java.lang.String THISATTR

NAME_ATTR

public static final java.lang.String NAME_ATTR

VALUE_ATTR

public static final java.lang.String VALUE_ATTR

TEXTSEPARATOR

public static final char TEXTSEPARATOR

SETUPEXTENSION

public static final java.lang.String SETUPEXTENSION

INC_HREF

public static final java.lang.String INC_HREF

INC_PATH

public static final java.lang.String INC_PATH

INC_LIST

public static final java.lang.String INC_LIST

INC_DIR

public static final java.lang.String INC_DIR

INC_EXCL

public static final java.lang.String INC_EXCL

INC_SEP

public static final java.lang.String INC_SEP

listeners

protected static java.util.List listeners

defaultConfig

protected static ConfigFileNode defaultConfig

spf

protected static javax.xml.parsers.SAXParserFactory spf
Hold a SaxParserFactory to instantiate parsers only
Method Detail

parse

public static ConfigFileNode parse(org.xml.sax.InputSource is)
                            throws java.io.IOException,
                                   org.xml.sax.SAXException
Parse setup tree from an InputSource

parse

public static ConfigFileNode parse(org.xml.sax.InputSource is,
                                   ConfigParamMap pm)
                            throws java.io.IOException,
                                   org.xml.sax.SAXException

newSAXParser

protected static javax.xml.parsers.SAXParser newSAXParser()
                                                   throws org.xml.sax.SAXException,
                                                          javax.xml.parsers.ParserConfigurationException
obtain a new parser

setConfig

public static ConfigNode setConfig(ConfigFileNode setup)

getConfig

public static ConfigNode getConfig()

addListener

public static void addListener(ConfigListener listener)
We supply a preliminary api to inform listeners about a change in configuration.

removeListener

public static void removeListener(ConfigListener listener)

handleChange

protected static void handleChange(ConfigNode s)

More information