|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.syphr.prom.PropertiesManagers
public class PropertiesManagers
This class provides builder methods to construct managers
with various options.
Method Summary | ||
---|---|---|
static
|
getDefaultProperties(Class<T> keyType,
Translator<T> translator)
Retrieve a Properties instance that contains all of the default
values defined for the given Defaultable . |
|
static
|
getDefaultTranslator(Class<T> enumType)
Get the default translator to convert back and forth between Enums and property names (keys). |
|
static Properties |
getProperties(File file)
Load values from a file. |
|
static
|
newManager(File file,
Class<T> keyType)
Build a new manager for the given properties file. |
|
static
|
newManager(File file,
Class<T> keyType,
Evaluator evaluator,
ExecutorService executor)
Build a new manager for the given properties file. |
|
static
|
newManager(File file,
Class<T> keyType,
ExecutorService executor)
Build a new manager for the given properties file. |
|
static
|
newManager(File file,
Class<T> keyType,
Translator<T> translator,
ExecutorService executor)
Build a new manager for the given properties file. |
|
static
|
newManager(File file,
File defaultFile,
Class<T> keyType)
Build a new manager for the given properties file. |
|
static
|
newManager(File file,
File defaultFile,
Class<T> keyType,
ExecutorService executor)
Build a new manager for the given properties file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T extends Enum<T>> PropertiesManager<T> newManager(File file, File defaultFile, Class<T> keyType) throws IOException
T
- the type of key used for the new managerfile
- the file system location of the properties represented by the
new managerdefaultFile
- a file containing default values for the properties
represented by the new managerkeyType
- the enumeration of keys in the properties file
IOException
- if there is an error while reading the default propertiespublic static <T extends Enum<T>> PropertiesManager<T> newManager(File file, File defaultFile, Class<T> keyType, ExecutorService executor) throws IOException
T
- the type of key used for the new managerfile
- the file system location of the properties represented by the
new managerdefaultFile
- a file containing default values for the properties
represented by the new managerkeyType
- the enumeration of keys in the properties fileexecutor
- a service to handle potentially long running tasks, such as
interacting with the file system
IOException
- if there is an error while reading the default propertiespublic static <T extends Enum<T> & Defaultable> PropertiesManager<T> newManager(File file, Class<T> keyType)
T
- the type of key used for the new managerfile
- the file system location of the properties represented herekeyType
- the enumeration of keys in the properties file
public static <T extends Enum<T> & Defaultable> PropertiesManager<T> newManager(File file, Class<T> keyType, ExecutorService executor)
T
- the type of key used for the new managerfile
- the file system location of the properties represented herekeyType
- the enumeration of keys in the properties fileexecutor
- a service to handle potentially long running tasks, such as
interacting with the file system
public static <T extends Enum<T> & Defaultable> PropertiesManager<T> newManager(File file, Class<T> keyType, Translator<T> translator, ExecutorService executor)
T
- the type of key used for the new managerfile
- the file system location of the properties represented herekeyType
- the enumeration of keys in the properties filetranslator
- the translator to convert between Enum names and property keysexecutor
- a service to handle potentially long running tasks, such as
interacting with the file system
public static <T extends Enum<T> & Defaultable> PropertiesManager<T> newManager(File file, Class<T> keyType, Evaluator evaluator, ExecutorService executor)
T
- the type of key used for the new managerfile
- the file system location of the properties represented herekeyType
- the enumeration of keys in the properties fileevaluator
- the evaluator to convert nested property references into fully
evaluated stringsexecutor
- a service to handle potentially long running tasks, such as
interacting with the file system
public static Properties getProperties(File file) throws IOException
file
- the file containing default values
IOException
- if there is an error while reading the given filepublic static <T extends Enum<T> & Defaultable> Properties getDefaultProperties(Class<T> keyType, Translator<T> translator)
Properties
instance that contains all of the default
values defined for the given Defaultable
.
T
- the key type whose default values are requestedkeyType
- the class that contains the appropriate defaultstranslator
- a translator to convert between key instances and property
names
Properties
instance containing the default values
stored in the given key typepublic static <T extends Enum<T>> Translator<T> getDefaultTranslator(Class<T> enumType)
T
- the type of Enum representing the propertiesenumType
- the Enum class used to represent the properties
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |