Constructor and Description |
---|
Configurer(Media media)
Load data from configuration media.
|
Modifier and Type | Method and Description |
---|---|
static void |
clearCache()
Clear classes cache.
|
boolean |
getBoolean(String attribute,
String... path)
Get a boolean in the xml tree.
|
boolean |
getBooleanDefault(boolean defaultValue,
String attribute,
String... path)
Get a boolean in the xml tree.
|
double |
getDouble(String attribute,
String... path)
Get a double in the xml tree.
|
double |
getDoubleDefault(double defaultValue,
String attribute,
String... path)
Get a double in the xml tree.
|
<T> T |
getImplementation(Class<T> type,
Class<?>[] paramsType,
Collection<?> paramsValue,
String... path)
Get the class implementation from its name by using a custom constructor.
|
<T> T |
getImplementation(Class<T> type,
Class<?> paramType,
Object paramValue,
String... path)
Get the class implementation from its name by using a custom constructor.
|
<T> T |
getImplementation(Class<T> type,
String... path)
Get the class implementation from its name.
|
<T> T |
getImplementation(ClassLoader loader,
Class<T> type,
Class<?>[] paramsType,
Collection<?> paramsValue,
String... path)
Get the class implementation from its name by using a custom constructor.
|
static <T> T |
getImplementation(ClassLoader loader,
Class<T> type,
Class<?>[] paramsType,
Collection<?> paramsValue,
String className)
Get the class implementation from its name by using a custom constructor.
|
<T> T |
getImplementation(ClassLoader loader,
Class<T> type,
String... path)
Get the class implementation from its name.
|
int |
getInteger(String attribute,
String... path)
Get an integer in the xml tree.
|
int |
getIntegerDefault(int defaultValue,
String attribute,
String... path)
Get an integer in the xml tree.
|
Media |
getMedia()
Return the associated media.
|
String |
getPath()
Get the configuration directory path.
|
Xml |
getRoot()
Get the data root container for raw access.
|
String |
getString(String attribute,
String... path)
Get a string in the xml tree.
|
String |
getStringDefault(String defaultValue,
String attribute,
String... path)
Get a string in the xml tree.
|
String |
getText(String... path)
Get the node text value.
|
String |
getTextDefault(String defaultValue,
String... path)
Get the node text value.
|
boolean |
hasNode(String... path)
Check if node exists.
|
void |
save()
Save the configurer.
|
public Configurer(Media media)
media
- The xml media.LionEngineException
- If error when opening the media.public static void clearCache()
public final void save()
LionEngineException
- If error on saving.public final Xml getRoot()
public final String getPath()
public final Media getMedia()
public final String getText(String... path)
path
- The node path.LionEngineException
- If unable to read node.public final String getTextDefault(String defaultValue, String... path)
defaultValue
- Value used if node does not exist.path
- The node path.public final String getString(String attribute, String... path)
attribute
- The attribute to get as string.path
- The node path (child list)LionEngineException
- If unable to read node.public final String getStringDefault(String defaultValue, String attribute, String... path)
defaultValue
- Value used if node does not exist.attribute
- The attribute to get as string.path
- The node path (child list)LionEngineException
- If unable to read node.public final boolean getBoolean(String attribute, String... path)
attribute
- The attribute to get as boolean.path
- The node path (child list)LionEngineException
- If unable to read node.public final boolean getBooleanDefault(boolean defaultValue, String attribute, String... path)
defaultValue
- Value used if node does not exist.attribute
- The attribute to get as boolean.path
- The node path (child list)LionEngineException
- If unable to read node.public final int getInteger(String attribute, String... path)
attribute
- The attribute to get as integer.path
- The node path (child list)LionEngineException
- If unable to read node or not a valid integer read.public final int getIntegerDefault(int defaultValue, String attribute, String... path)
defaultValue
- Value used if node does not exist.attribute
- The attribute to get as integer.path
- The node path (child list)LionEngineException
- If not a valid integer read.public final double getDouble(String attribute, String... path)
attribute
- The attribute to get as double.path
- The node path (child list)LionEngineException
- If unable to read node.public final double getDoubleDefault(double defaultValue, String attribute, String... path)
defaultValue
- Value used if node does not exist.attribute
- The attribute to get as double.path
- The node path (child list)LionEngineException
- If unable to read node.public final <T> T getImplementation(Class<T> type, String... path)
T
- The instance type.type
- The class type.path
- The node path.LionEngineException
- If invalid class.public final <T> T getImplementation(ClassLoader loader, Class<T> type, String... path)
T
- The instance type.loader
- The class loader to use.type
- The class type.path
- The node path.LionEngineException
- If invalid class.public final <T> T getImplementation(Class<T> type, Class<?> paramType, Object paramValue, String... path)
T
- The instance type.type
- The class type.paramType
- The parameter type.paramValue
- The parameter value.path
- The node path.LionEngineException
- If invalid class.public final <T> T getImplementation(Class<T> type, Class<?>[] paramsType, Collection<?> paramsValue, String... path)
T
- The instance type.type
- The class type.paramsType
- The parameters type.paramsValue
- The parameters value.path
- The node path.LionEngineException
- If invalid class.public final <T> T getImplementation(ClassLoader loader, Class<T> type, Class<?>[] paramsType, Collection<?> paramsValue, String... path)
T
- The instance type.loader
- The class loader to use.type
- The class type.paramsType
- The parameters type.paramsValue
- The parameters value.path
- The node path.LionEngineException
- If invalid class.public static final <T> T getImplementation(ClassLoader loader, Class<T> type, Class<?>[] paramsType, Collection<?> paramsValue, String className)
T
- The instance type.loader
- The class loader to use.type
- The class type.paramsType
- The parameters type.paramsValue
- The parameters value.className
- The class name.LionEngineException
- If invalid class.public final boolean hasNode(String... path)
path
- The node path.true
if node exists, false
else.Copyright © 2017 Byron 3D Games Studio. All rights reserved.