|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jconfig.handler.AbstractHandler
org.jconfig.handler.BaseXMLHandler
org.jconfig.handler.InputStreamHandler
This class is an implementation of the ConfigurationHandler interface. It tries to find the file with the given name inside the classpath with getClassLoader().getResourceAsStream(fileName). This handler is used as default by the ConfigurationManager.
Constructor Summary | |
InputStreamHandler()
Default constructor |
|
InputStreamHandler(java.lang.String filename)
Constructor with filename |
Method Summary | |
java.io.File |
getFile()
The File that should be "watched" for changes. |
Configuration |
load(java.lang.String configurationName)
Loads the configuration from a xml file. |
Configuration |
load(java.lang.String configurationName,
ConfigurationParser parser)
This method will read in a file and generate the properties |
void |
setFileName(java.lang.String fileName)
Sets the filename |
void |
setValidation(boolean validate)
Defines if the xml file should be validated using a DTD or not. |
void |
store(Configuration configuration)
This method should store all categories and properties. |
Methods inherited from class org.jconfig.handler.BaseXMLHandler |
getEncodingType, setEncoding, store |
Methods inherited from class org.jconfig.handler.AbstractHandler |
addFileListener, fileChanged, fireFireChangedEvent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InputStreamHandler()
public InputStreamHandler(java.lang.String filename)
filename
- Method Detail |
public void setFileName(java.lang.String fileName)
public void setValidation(boolean validate)
public Configuration load(java.lang.String configurationName) throws ConfigurationManagerException
load
in interface ConfigurationHandler
configurationName
- the name of the configuration
ConfigurationManagerException
public Configuration load(java.lang.String configurationName, ConfigurationParser parser) throws ConfigurationManagerException
load
in interface ConfigurationHandler
configurationName
- the name of the configurationparser
- the parser that should be used
ConfigurationManagerException
- if the file cannot be processedpublic void store(Configuration configuration) throws ConfigurationManagerException
store
in interface ConfigurationHandler
configuration
- the Configuration that should be saved
ConfigurationManagerException
public java.io.File getFile()
AbstractHandler
getFile
in class AbstractHandler
org.jconfig.handler.ConfigurationHandler#getFile()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |