Interface FormulaContext

  • All Known Implementing Classes:
    DefaultFormulaContext

    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 Detail

      • isReferenceDirty

        boolean isReferenceDirty​(Object name)
                          throws EvaluationException
        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:
        EvaluationException - if an error occurs.
      • resolveReference

        Object resolveReference​(Object name)
                         throws EvaluationException
        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:
        EvaluationException - if an error occurs.
      • resolveReferenceType

        Type resolveReferenceType​(Object name)
                           throws EvaluationException
        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:
        EvaluationException - if an error occurs.
      • getLocalizationContext

        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.
      • getConfiguration

        org.pentaho.reporting.libraries.base.config.Configuration getConfiguration()
        Returns the local configuration of the formula.
        Returns:
        the local configuration.
      • getFunctionRegistry

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

        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.
      • getOperatorFactory

        OperatorFactory getOperatorFactory()
        Returns the operator registry. The Operator-registry contains all operator-implementations.
        Returns:
        the operator registry.
      • getCurrentDate

        Date getCurrentDate()
        Returns the current date.
        Returns:
        the date.