public class XmlConfiguration extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBoolean(String _key,
boolean _default)
Retrieve a configuration value as boolean.
|
double |
getDouble(String _key,
double _default)
Retrieve a configuration value as double.
|
File |
getInputFile()
Get file which is used as input
|
int |
getInt(String _key,
int _default)
Get a configuration value as int.
|
String |
getKeyDelimiter()
Get the delimiting key (default is '/').
|
String |
getString(String _key)
Get the String value behind the given key.
|
String |
getString(String _key,
String _default)
Get the string value behind the given key or return default.
|
List<String> |
getStringList(String _key)
Returns the results of key as ArrayList.
|
Set<String> |
getStringSet(String _key,
Class<? extends Set> _setClass)
Returns a result as Set of the given Set-Subclass.
|
int |
keyCount()
Get the amount of nodes in config.
|
void |
save()
Save config file.
|
void |
save(BiConsumer<Document,OutputStream> _outputGenerator)
Save config using
BiConsumer. |
void |
setKeyDelimiter(String _keyDelimiter)
Set the delimiting key.
|
void |
setString(String _key,
boolean _asAttribute,
String _value)
Set string value of given key
|
void |
setValues(Map<String,String> _values,
boolean _asAttributes)
Set keys found in map to value found in map.
|
public String getKeyDelimiter()
public void setKeyDelimiter(String _keyDelimiter)
_keyDelimiter - public int keyCount()
public String getString(String _key)
_key - key to look forpublic String getString(String _key, String _default)
_key - key to look for_default - default to return if key not foundpublic int getInt(String _key, int _default)
_key - _default - public double getDouble(String _key, double _default)
_key - _default - public boolean getBoolean(String _key, boolean _default)
_key - _default - public void setString(String _key, boolean _asAttribute, String _value)
_key - key to write_asAttribute - set this as attribute instead of node_value - value to writepublic List<String> getStringList(String _key)
_key - public Set<String> getStringSet(String _key, Class<? extends Set> _setClass)
_key - _setClass - public void setValues(Map<String,String> _values, boolean _asAttributes)
_values - values to write_asAttributes - write values as attributes instead of nodespublic void save()
throws IOException
IOExceptionpublic void save(BiConsumer<Document,OutputStream> _outputGenerator) throws IOException
BiConsumer.
This allows transforming/formatting of output before it is saved to the configured output stream._outputGenerator - IOExceptionpublic File getInputFile()
Copyright © 2018. All rights reserved.