public class SurfConfiguration
extends org.apache.commons.configuration2.BaseHierarchicalConfiguration
implements org.apache.commons.configuration2.FileBasedConfiguration
FileBasedConfiguration that uses a SURF file to store information.
If a SURF configuration file is created by an instance of this class, it will be composed by a root SurfObject with the type name defined as
"Configuration", and every property added to this SurfConfiguration instance will be a child of this SurfObject.
*Configuration: property1 = value1 property2 = value2 property3 = value3 ;
The SURF document serialized will always be formatter. See SurfSerializer.setFormatted(boolean).
| Constructor and Description |
|---|
SurfConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPropertyInternal(String key,
Object obj) |
protected void |
clearPropertyDirect(String key) |
protected Object |
getPropertyInternal(String key) |
io.urf.surf.parser.SurfObject |
getSurfDocument()
Returns the SURF document of this configuration.
|
protected boolean |
isEmptyInternal() |
void |
read(Reader in) |
protected int |
sizeInternal() |
void |
write(Writer out) |
childConfigurationsAt, childConfigurationsAt, cloneNodeModel, configurationAt, configurationAt, configurationsAt, configurationsAt, createSubConfigurationForTrackedNode, getNodeModel, getSubConfigurationNodeSelector, getSubConfigurationParentModel, immutableChildConfigurationsAt, immutableConfigurationAt, immutableConfigurationAt, immutableConfigurationsAt, initSubConfigurationForThisParent, interpolatedConfiguration, subnodeConfigurationChanged, subsetaddNodes, addNodesInternal, addPropertyDirect, clearInternal, clearTree, clearTreeInternal, clone, containsKeyInternal, fetchNodeList, getExpressionEngine, getKeysInternal, getKeysInternal, getMaxIndex, getMaxIndexInternal, getModel, getRootElementName, getRootElementNameInternal, nodeDefined, nodeKey, resolveAddKey, resolveKey, resolveNodeKey, resolveUpdateKey, setExpressionEngine, setPropertyInternaladdErrorLogListener, addProperty, append, beginRead, beginWrite, clear, clearProperty, cloneInterpolator, containsKey, copy, endRead, endWrite, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getConfigurationDecoder, getConversionHandler, getDouble, getDouble, getDouble, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getKeys, getList, getList, getList, getList, getListDelimiterHandler, getLogger, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getSynchronizer, immutableSubset, initLogger, installInterpolator, interpolate, interpolate, isEmpty, isScalarValue, isThrowExceptionOnMissing, lock, setConfigurationDecoder, setConversionHandler, setDefaultLookups, setInterpolator, setListDelimiterHandler, setLogger, setParentInterpolator, setPrefixLookups, setProperty, setSynchronizer, setThrowExceptionOnMissing, size, unlockaddEventListener, clearErrorListeners, clearEventListeners, copyEventListeners, createErrorEvent, createEvent, fireError, fireEvent, getEventListenerRegistrations, getEventListeners, isDetailEvents, removeEventListener, setDetailEventsequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddProperty, clear, clearProperty, getInterpolator, installInterpolator, setInterpolator, setProperty, subsetcontainsKey, get, get, getArray, getArray, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCollection, getCollection, getDouble, getDouble, getDouble, getEncodedString, getEncodedString, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getKeys, getList, getList, getList, getList, getLong, getLong, getLong, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, immutableSubset, isEmpty, sizepublic void read(@Nonnull Reader in) throws org.apache.commons.configuration2.ex.ConfigurationException, IOException
If an empty file is provided to the FileHandler, then we create the root object using as the type name.
read in interface org.apache.commons.configuration2.io.FileBasedorg.apache.commons.configuration2.ex.ConfigurationException - if the root element is not an instance of SurfObject or if the Reader provided refers to a non-existing
file.IOExceptionpublic void write(@Nonnull Writer out) throws org.apache.commons.configuration2.ex.ConfigurationException, IOException
write in interface org.apache.commons.configuration2.io.FileBasedorg.apache.commons.configuration2.ex.ConfigurationExceptionIOExceptionprotected Object getPropertyInternal(@Nonnull String key)
getPropertyInternal in class org.apache.commons.configuration2.AbstractHierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>protected void addPropertyInternal(@Nonnull String key, @Nullable Object obj)
addPropertyInternal in class org.apache.commons.configuration2.AbstractHierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>protected void clearPropertyDirect(String key)
clearPropertyDirect in class org.apache.commons.configuration2.AbstractHierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>protected boolean isEmptyInternal()
isEmptyInternal in class org.apache.commons.configuration2.AbstractHierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>protected int sizeInternal()
sizeInternal in class org.apache.commons.configuration2.AbstractHierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>public io.urf.surf.parser.SurfObject getSurfDocument()
null if it wasn't loaded from a file.Copyright © 2017 GlobalMentor, Inc.. All rights reserved.