tot.xml
类 DOM4JConfiguration

java.lang.Object
  继承者 tot.xml.AbstractConfiguration
      继承者 tot.xml.BaseConfiguration
          继承者 tot.xml.BasePathConfiguration
              继承者 tot.xml.XMLConfiguration
                  继承者 tot.xml.DOM4JConfiguration
所有已实现的接口:
BasePathLoader, Configuration

public class DOM4JConfiguration
extends XMLConfiguration

Reads a XML configuration file. To retrieve the value of an attribute of an element, use X.Y.Z[@attribute]. The '@' symbol was chosen for consistency with XPath. Setting property values will NOT automatically persist changes to disk, unless autoSave=true.

自从:
0.8.1

字段摘要
 
从类 tot.xml.AbstractConfiguration 继承的字段
defaults, END_TOKEN, START_TOKEN
 
构造函数摘要
DOM4JConfiguration()
          Empty construtor.
DOM4JConfiguration(java.io.File file)
          Attempts to load the XML file.
DOM4JConfiguration(java.lang.String resource)
          Attempts to load the XML file as a resource from the classpath.
 
方法摘要
 void addProperty(java.lang.String name, java.lang.Object value)
          Calls super method, and also ensures the underlying Document is modified so changes are persisted when saved.
 void clearProperty(java.lang.String name)
          Calls super method, and also ensures the underlying Document is modified so changes are persisted when saved.
 java.io.File getFile()
          Returns the file.
 java.lang.String getFileName()
          Returns the fileName.
 void load()
           
 void save()
           
 void setAutoSave(boolean autoSave)
          If true, changes are automatically persisted.
 void setFile(java.io.File file)
          Sets the file.
 void setFileName(java.lang.String fileName)
           
 void setProperty(java.lang.String name, java.lang.Object value)
          Calls super method, and also ensures the underlying Document is modified so changes are persisted when saved.
 
从类 tot.xml.BasePathConfiguration 继承的方法
getBasePath, setBasePath
 
从类 tot.xml.BaseConfiguration 继承的方法
addPropertyDirect, containsKey, getKeys, getPropertyDirect, isEmpty
 
从类 tot.xml.AbstractConfiguration 继承的方法
getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getVector, getVector, interpolate, interpolateHelper, processString, subset, testBoolean
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造函数详细信息

DOM4JConfiguration

public DOM4JConfiguration()
Empty construtor. You must provide a file/fileName and call the load method


DOM4JConfiguration

public DOM4JConfiguration(java.lang.String resource)
                   throws java.lang.Exception
Attempts to load the XML file as a resource from the classpath. The XML file must be located somewhere in the classpath.

参数:
resource - Name of the resource
抛出:
java.lang.Exception - If error reading data source.
另请参见:
DOM4JConfiguration(File)

DOM4JConfiguration

public DOM4JConfiguration(java.io.File file)
                   throws java.lang.Exception
Attempts to load the XML file.

参数:
file - File object representing the XML file.
抛出:
java.lang.Exception - If error reading data source.
方法详细信息

load

public void load()
          throws java.lang.Exception
抛出:
java.lang.Exception

addProperty

public void addProperty(java.lang.String name,
                        java.lang.Object value)
Calls super method, and also ensures the underlying Document is modified so changes are persisted when saved.

指定者:
接口 Configuration 中的 addProperty
覆盖:
AbstractConfiguration 中的 addProperty
参数:
name -
value -

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Calls super method, and also ensures the underlying Document is modified so changes are persisted when saved.

指定者:
接口 Configuration 中的 setProperty
覆盖:
AbstractConfiguration 中的 setProperty
参数:
name -
value -

clearProperty

public void clearProperty(java.lang.String name)
Calls super method, and also ensures the underlying Document is modified so changes are persisted when saved.

指定者:
接口 Configuration 中的 clearProperty
覆盖:
BaseConfiguration 中的 clearProperty
参数:
name - The name of the property to clear.

setAutoSave

public void setAutoSave(boolean autoSave)
If true, changes are automatically persisted.

参数:
autoSave -

save

public void save()
          throws java.io.IOException
抛出:
java.io.IOException

getFile

public java.io.File getFile()
Returns the file.

返回:
File

setFile

public void setFile(java.io.File file)
Sets the file.

参数:
file - The file to set

setFileName

public void setFileName(java.lang.String fileName)

getFileName

public java.lang.String getFileName()
Returns the fileName.

返回:
String