Class ContextFunction

  • All Implemented Interfaces:
    IContextFunction

    public abstract class ContextFunction
    extends Object
    implements IContextFunction
    The base class for all computed value implementations. Clients may subclass this class. See the class comment of IContextFunction for specific rules that must be followed by function implementations.

    This class is intended to be subclassed by clients.

    Since:
    1.3
    See Also:
    IContextFunction
    • Constructor Detail

      • ContextFunction

        public ContextFunction()
        Constructs a new instance of the context function
    • Method Detail

      • compute

        public Object compute​(IEclipseContext context,
                              String contextKey)
        Description copied from interface: IContextFunction
        Evaluates the function based on the provided arguments and context to produce a consistent result.
        Specified by:
        compute in interface IContextFunction
        Parameters:
        context - The context in which to perform the value computation.
        contextKey - The context key used to find this function; may be null such as if invoked directly.
        Returns:
        The concrete value. Implementations may return IInjector.NOT_A_VALUE to cause lookup to continue up the context hierarchy.