public abstract class AbstractXMLFilePropertyIO extends AbstractFilePropertyIO
File,
Serialized Form| Constructor and Description |
|---|
AbstractXMLFilePropertyIO(File file)
Returns a
AbstractXMLFilePropertyIO with loads properties from the file. |
AbstractXMLFilePropertyIO(File file,
boolean readonly)
Returns a
AbstractXMLFilePropertyIO with loads properties from the file. |
AbstractXMLFilePropertyIO(File file,
boolean readonly,
boolean cached)
Returns a
AbstractXMLFilePropertyIO with loads properties from the file. |
| Modifier and Type | Method and Description |
|---|---|
Properties |
getProperties()
Gets all the name,value pair in a Properties class instance.
|
protected abstract Properties |
loadXml(File file)
Loads the properties from the XML file.
|
void |
reload()
Reloads the name,value pairs for the PropertyIO, or forces the values to reload when read next time.
|
protected abstract void |
saveXml(Properties properties,
File file)
Saving the properties to the XML file, if that is possible.
|
void |
setValue(String propertyName,
String value)
Sets the name,value as String in the IO.
|
void |
validate()
Validates the PropertyIO.
|
getFile, getName, getSourcebackup, getCacheTime, getLastLoaded, getLastSaved, getLogger, getTypedProperties, getTypedValue, getValue, isCached, isReadonly, logPerformanceGetProperties, logPerformanceSetValue, setCacheTime, storeTypedValue, updateLastLoaded, updateLastSaved, validateWritablepublic AbstractXMLFilePropertyIO(File file)
AbstractXMLFilePropertyIO with loads properties from the file. false and cached is set to true.file - the file to load properties from.public AbstractXMLFilePropertyIO(File file, boolean readonly)
AbstractXMLFilePropertyIO with loads properties from the file.
Attributes cached is set to true.file - the file to load properties from.readonly - is the FilePropertyIO to be read only.public AbstractXMLFilePropertyIO(File file, boolean readonly, boolean cached)
AbstractXMLFilePropertyIO with loads properties from the file.file - readonly - is the AbstractXMLFilePropertyIO to be read only.cached - shall the values be cached in the PropertyIO's.public final void reload()
PropertyIOreload in interface PropertyIOreload in class AbstractPropertyIOpublic final void validate()
throws PropertyIOException
PropertyIOvalidate in interface PropertyIOvalidate in class AbstractFilePropertyIOPropertyIOExceptionpublic final Properties getProperties()
PropertyIOPropertiespublic final void setValue(String propertyName, String value) throws PropertyIOException
PropertyIOpropertyName - the name of the propertyvalue - the string value of the property.PropertyIOException - if the IO is readonly or failed to write the value.protected abstract Properties loadXml(File file) throws PropertyIOException
file - the XML filePropertyIOException - if any failure loading the properties.XMLUtils.loadXmlFromFile(File)protected abstract void saveXml(Properties properties, File file) throws PropertyIOException
properties - the Properties to be saved.file - the file to save to.PropertyIOException - if either problems saving, or saving is not possible.