| java.lang.Object com.flexive.shared.configuration.ParameterFactory
ParameterFactory | final public class ParameterFactory (Code) | |
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 .
author: Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) version: $Rev: 181 $ |
Method Summary | |
public static Parameter<T> | newInstance(Class<T> cls, ParameterData<T> data) | public static Parameter<T> | newInstance(Class<T> cls, ParameterPath path, String key, T defaultValue) | public static Parameter<T> | newInstance(Class<T> cls, ParameterPath path, T defaultValue) | public static Parameter<T> | newInstance(Class<T> cls, String path, ParameterScope scope, String key, T defaultValue) | public static Parameter<T> | newInstance(Class<T> cls, String path, ParameterScope scope, T defaultValue) |
|
|