|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flexive.shared.configuration.parameters.ParameterFactory
public final class ParameterFactory
This factory beans provides methods for instantiating new parameter objects to be used with
flexive's configuration API. To create a typesafe parameter definition, you must supply
the parameter class (e.g. Long) and the attributes describing the parameter itself,
such as the (global) path it's stored under and its scope (e.g. user- or division-scoped).
:
// define a boolean parameter "booleanParam" for path "/configuration" with a default value of false Parameter<Boolean> bp = ParameterFactory.newInstance(Boolean.class, "/configuration", ParameterScope.USER, "booleanParam", false); // define a long parameter with a default value of 25 Parameter<Long> lp = ParameterFactory.newInstance(Long.class, "/configuration", ParameterScope.USER, "longParam", 25L); // define an object parameter for QueryRootNode.class with no default value that works by serializing the objects via XStream Parameter<QueryRootNode> DEFAULT_QUERY = ParameterFactory.newInstance(QueryRootNode.class, "/configuration", ParameterScope.USER, "defaultQuery", null);More examples can be found in
SystemParameters.
| Method Summary | ||
|---|---|---|
static
|
newInstance(java.lang.Class<T> cls,
ParameterData<T> data)
Creates a new parameter from a ParameterData instance. |
|
static
|
newInstance(java.lang.Class<T> cls,
ParameterPath path,
java.lang.String key,
T defaultValue)
Create a new parameter with key and default value, using path information from a ParameterPath object. |
|
static
|
newInstance(java.lang.Class<T> cls,
ParameterPath path,
T defaultValue)
Create a new parameter without a specific key and a default value. |
|
static
|
newInstance(java.lang.Class<T> cls,
java.lang.String path,
ParameterScope scope,
java.lang.String key,
T defaultValue)
Create a new parameter for a path with key and default value. |
|
static
|
newInstance(java.lang.Class<T> cls,
java.lang.String path,
ParameterScope scope,
T defaultValue)
Create a new parameter for a path with a default value, but without a fixed key. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> Parameter<T> newInstance(java.lang.Class<T> cls,
ParameterData<T> data)
ParameterData instance.
cls - the parameter type classdata - the bean holding all parameter properties
public static <T> Parameter<T> newInstance(java.lang.Class<T> cls,
ParameterPath path,
java.lang.String key,
T defaultValue)
ParameterPath object.
cls - the parameter type classpath - the path descriptionkey - the parameter keydefaultValue - the default value (if null, no default value will be used)
public static <T> Parameter<T> newInstance(java.lang.Class<T> cls,
ParameterPath path,
T defaultValue)
cls - the parameter type classpath - the path descriptiondefaultValue - the default value (if null, no default value will be used)
public static <T> Parameter<T> newInstance(java.lang.Class<T> cls,
java.lang.String path,
ParameterScope scope,
java.lang.String key,
T defaultValue)
cls - the parameter type classpath - the path descriptionscope - the parameter scope (user, division, or global)key - the parameter keydefaultValue - the default value (if null, no default value will be used)
public static <T> Parameter<T> newInstance(java.lang.Class<T> cls,
java.lang.String path,
ParameterScope scope,
T defaultValue)
cls - the parameter type classpath - the path descriptionscope - the parameter scope (user, division, or global)defaultValue - the default value (if null, no default value will be used)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||