org.jconfig.handler
Class XMLFileHandler

java.lang.Object
  extended byorg.jconfig.handler.AbstractHandler
      extended byorg.jconfig.handler.BaseXMLHandler
          extended byorg.jconfig.handler.XMLFileHandler
All Implemented Interfaces:
ConfigurationHandler, java.util.EventListener, FileListener

public class XMLFileHandler
extends BaseXMLHandler
implements ConfigurationHandler

This class is nearly the same as the InputStreamHandler beside that it takes a file and not the filename.

Author:
Andreas Mecky andreas.mecky@xcom.de, Terry Dye terry.dye@xcom.de

Constructor Summary
XMLFileHandler()
           
XMLFileHandler(java.lang.String filename)
           
 
Method Summary
 java.io.File getFile()
          The File that should be "watched" for changes.
 Configuration load(java.io.File file, java.lang.String configurationName)
           
 Configuration load(java.io.File file, java.lang.String configName, ConfigurationParser parser)
           
 Configuration load(java.lang.String configurationName)
          This method loads a configuration and returns it
 Configuration load(java.lang.String configurationName, ConfigurationParser parser)
          This method loads a configuration using a specific parser and returns it
 void setFile(java.io.File file)
          Sets the file that will be processed
 void setValidation(boolean validate)
          This defines if the file will be vaidated using a DTD.
 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

XMLFileHandler

public XMLFileHandler()

XMLFileHandler

public XMLFileHandler(java.lang.String filename)
Method Detail

setFile

public void setFile(java.io.File file)
Sets the file that will be processed

Parameters:
file - the file

setValidation

public void setValidation(boolean validate)
This defines if the file will be vaidated using a DTD. The default is false.

Parameters:
validate - defines the validation

load

public Configuration load(java.lang.String configurationName)
                   throws ConfigurationManagerException
Description copied from interface: ConfigurationHandler
This method loads a configuration and returns it

Specified by:
load in interface ConfigurationHandler
Parameters:
configurationName - the name of the configuration
Returns:
the Configuration
Throws:
ConfigurationManagerException

load

public Configuration load(java.lang.String configurationName,
                          ConfigurationParser parser)
                   throws ConfigurationManagerException
Description copied from interface: ConfigurationHandler
This method loads a configuration using a specific parser and returns it

Specified by:
load in interface ConfigurationHandler
Parameters:
configurationName - the name of the configuration
parser - the parser that should be used
Returns:
the Configuration
Throws:
ConfigurationManagerException

load

public Configuration load(java.io.File file,
                          java.lang.String configurationName)
                   throws ConfigurationManagerException
Throws:
ConfigurationManagerException

load

public Configuration load(java.io.File file,
                          java.lang.String configName,
                          ConfigurationParser parser)
                   throws ConfigurationManagerException
Parameters:
file -
Throws:
ConfigurationManagerException

store

public void store(Configuration configuration)
           throws ConfigurationManagerException
This method should store all categories and properties.

Specified by:
store in interface ConfigurationHandler
Parameters:
configuration - the Configuration that should be saved
Throws:
ConfigurationManagerException

getFile

public java.io.File getFile()
Description copied from class: AbstractHandler
The File that should be "watched" for changes.

Specified by:
getFile in class AbstractHandler
Returns:
The File object


Copyright © 2001-2005 Andreas Mecky, Terry Dye. All Rights Reserved.