org.jfree.formula

Interface FormulaContext

public interface FormulaContext

The formula-context connects the formula functions with the outside world. The context can be used to resolve external references, to query the configuration or to retrieve information about the formula-evaluation system.

Author: Thomas Morgner

Method Summary
ConfigurationgetConfiguration()
Returns the local configuration of the formula.
FunctionRegistrygetFunctionRegistry()
Returns the function registry.
LocalizationContextgetLocalizationContext()
Returns the localization context of this formula.
OperatorFactorygetOperatorFactory()
Returns the operator registry.
TypeRegistrygetTypeRegistry()
Returns the type registry.
booleanisReferenceDirty(Object name)
Checks, whether the external object referenced by name has changed.
ObjectresolveReference(Object name)
Resolves the given reference.
TyperesolveReferenceType(Object name)
Queries the type of the given reference.

Method Detail

getConfiguration

public Configuration getConfiguration()
Returns the local configuration of the formula.

Returns: the local configuration.

getFunctionRegistry

public FunctionRegistry getFunctionRegistry()
Returns the function registry. The function registry grants access to all formula-function implementations.

Returns: the function registry.

getLocalizationContext

public LocalizationContext getLocalizationContext()
Returns the localization context of this formula. The localization context can be used to query locale specific configuration settings.

Returns: the localization context.

getOperatorFactory

public OperatorFactory getOperatorFactory()
Returns the operator registry. The Operator-registry contains all operator-implementations.

Returns: the operator registry.

getTypeRegistry

public TypeRegistry getTypeRegistry()
Returns the type registry. The type registry contains all type information and allows to convert values between different types.

Returns: the function registry.

isReferenceDirty

public boolean isReferenceDirty(Object name)
Checks, whether the external object referenced by name has changed.

Parameters: name the name that identifies the reference.

Returns: true, if the reference has changed, false otherwise.

Throws: ContextEvaluationException if an error occurs.

resolveReference

public Object resolveReference(Object name)
Resolves the given reference. How the name is interpreted by the outside system is an implementation detail.

Parameters: name the name that identifies the reference.

Returns: the resolved object.

Throws: ContextEvaluationException if an error occurs.

resolveReferenceType

public Type resolveReferenceType(Object name)
Queries the type of the given reference. How the name is interpreted by the outside system is an implementation detail. This return a LibFormula type object matching the type of the object that would be returned by resolveReference.

Parameters: name the name that identifies the reference.

Returns: the type of the resolved object.

Throws: ContextEvaluationException if an error occurs.