Package de.aristaflow.adept2.util
Class AristaFlowExpressionEngine
java.lang.Object
org.apache.commons.configuration2.tree.DefaultExpressionEngine
de.aristaflow.adept2.util.AristaFlowExpressionEngine
- All Implemented Interfaces:
ExpressionEngine
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.
-
Field Summary
Fields inherited from class org.apache.commons.configuration2.tree.DefaultExpressionEngine
INSTANCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new expression engine for aHierarchicalConfigurationdisabling attributes and indexes. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigurationSets a new expression engine for the designated configuration.Methods inherited from class org.apache.commons.configuration2.tree.DefaultExpressionEngine
attributeKey, canonicalKey, findLastPathNode, findNodesForKey, getSymbols, nodeKey, prepareAdd, query
-
Constructor Details
-
AristaFlowExpressionEngine
protected AristaFlowExpressionEngine()Creates a new expression engine for aHierarchicalConfigurationdisabling attributes and indexes.
-
-
Method Details
-
setExpressionEngine
Sets a new expression engine for the designated configuration. The expression engine is only relevant forAristaFlowExpressionEngines.
Note that this method has to be called for every new subset of a configuration. AHierarchicalConfigurationcreates 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.
-