org.jconfig.handler
Class XMLFileHandler

java.lang.Object
  |
  +--org.jconfig.handler.AbstractHandler
        |
        +--org.jconfig.handler.BaseXMLHandler
              |
              +--org.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()
           
 Configuration load(java.io.File file, java.lang.String configName)
           
 Configuration load(java.lang.String configurationName)
          This method loads a configuration 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
Throws:
ConfigurationManagerException -  

load

public Configuration load(java.io.File file,
                          java.lang.String configName)
                   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
Throws:
ConfigurationManagerException -  

getFile

public java.io.File getFile()
Overrides:
getFile in class AbstractHandler


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