Package de.aristaflow.adept2.util
Class AristaFlowExpressionEngine
- java.lang.Object
-
- org.apache.commons.configuration2.tree.DefaultExpressionEngine
-
- de.aristaflow.adept2.util.AristaFlowExpressionEngine
-
- All Implemented Interfaces:
org.apache.commons.configuration2.tree.ExpressionEngine
public class AristaFlowExpressionEngine extends org.apache.commons.configuration2.tree.DefaultExpressionEngine
An expression engine for hierarchical configurations of Apache Commons Configuration. Usually the default uses some intelligence to support indexed and attribute access in keys. We do not need this at all. However, we cannot just set the default expression engine. This is set statically. Therefore a customer may override our expression engine or we may override the expression engine of a customer. Neither is desired, we have to set the expression engine on an instance basis rather than on the class basis.Important! Since a
HierarchicalConfiguration
creates new instances for subsets, make sure to set our expression engine after retrieving a subset.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AristaFlowExpressionEngine()
Creates a new expression engine for aHierarchicalConfiguration
disabling attributes and indexes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.commons.configuration2.Configuration
setExpressionEngine(org.apache.commons.configuration2.Configuration conf)
Sets a new expression engine for the designated configuration.
-
-
-
Method Detail
-
setExpressionEngine
public static org.apache.commons.configuration2.Configuration setExpressionEngine(org.apache.commons.configuration2.Configuration conf)
Sets a new expression engine for the designated configuration. The expression engine is only relevant forAristaFlowExpressionEngine
s.
Note that this method has to be called for every new subset of a configuration. AHierarchicalConfiguration
creates new instances in this case which do not inherit the expression engine of the parent configuration.- Parameters:
conf
- The configuration in which to set a new expression engine if appropriate.- Returns:
- The designated configuration which allows to call this method in the call of the super-constructor.
-
-