Class AristaFlowExpressionEngine

java.lang.Object
org.apache.commons.configuration2.tree.DefaultExpressionEngine
de.aristaflow.adept2.util.AristaFlowExpressionEngine
All Implemented Interfaces:
ExpressionEngine

public class AristaFlowExpressionEngine extends 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 Details

    • AristaFlowExpressionEngine

      protected AristaFlowExpressionEngine()
      Creates a new expression engine for a HierarchicalConfiguration disabling attributes and indexes.
  • Method Details

    • setExpressionEngine

      public static Configuration setExpressionEngine(Configuration conf)
      Sets a new expression engine for the designated configuration. The expression engine is only relevant for AristaFlowExpressionEngines.
      Note that this method has to be called for every new subset of a configuration. A HierarchicalConfiguration 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.