Interface ConfigEvaluator

All Known Implementing Classes:

public interface ConfigEvaluator

Evaluates the content within ConfigResources.

A ConfigEvaluator generally handles a specific file type. A particular file type may have more than one possible evaluator, in which case selection of the evaluator is based upon some data within the resource.

Field Summary
static Object NO_VALUE
          Sentinel value indicating that an evaluator has no evaluation of a requested property.
Method Summary
 Object constructNode(ConstructionContext context)
          Creates a new node, ready for injection and decoration.
 Object evaluateProperty(PropertyEvaluationContext context, String property, Class<?> propertyType)
          Evaluates the configuration of a property.
 ConfigResource getInnerConfig(ConfigResource config, Iterable<String> pathParts)

Field Detail


static final Object NO_VALUE
Sentinel value indicating that an evaluator has no evaluation of a requested property. This is used to distinguish between "the result is null" and "there is no result".

Method Detail


ConfigResource getInnerConfig(ConfigResource config,
                              Iterable<String> pathParts)
                              throws ConfigurationException


Object constructNode(ConstructionContext context)
                     throws NodeProvisioningException
Creates a new node, ready for injection and decoration.

If the evaluator cannot construct the new node, implementations may delegate to super-configuration resources via ConstructionContext.superConstructNode(). If it does so, this method should not return null, since that causes the framework to do the delegation again.

To provision an alias, this method should return a NodeReference to the target node.

the result of the creation configuration, or null if there's no creation configured in this layer, or NO_VALUE if creation is explicitly disabled.


Object evaluateProperty(PropertyEvaluationContext context,
                        String property,
                        Class<?> propertyType)
                        throws PropertyEvaluationException
Evaluates the configuration of a property. The configuration resource is provided by the context. If the evaluator and/or the resource cannot provide a definitive value for the property, implementations must generally delegate to prior configuration resources via PropertyEvaluationContext.superEvaluateProperty(java.lang.String, java.lang.Class).

the value of the requested property, or NO_VALUE if there's no configuration for the property in any resource layer.
PropertyEvaluationException - if anything goes wrong while evaluating the property.

Copyright © 2001–2012 Todd V. Jonker. All Rights Reserved.