Class DateFormatEvaluator


  • public class DateFormatEvaluator
    extends Evaluator

    Formats values using a given date format.

    Pass three parameters:

    • An EntityField or a date expression to be parsed with the DateMathParser class If the value is in a String, then it is assumed to be a datemath expression, otherwise it resolved using a VariableResolver instance
    • A date format see SimpleDateFormat for the syntax.
    • The Locale to parse. (optional. Defaults to the Root Locale)
    • Constructor Detail

      • DateFormatEvaluator

        public DateFormatEvaluator()
    • Method Detail

      • evaluate

        public String evaluate​(String expression,
                               Context context)
        Description copied from class: Evaluator
        Return a String after processing an expression and a VariableResolver
        Specified by:
        evaluate in class Evaluator
        Parameters:
        expression - string to be evaluated
        context - instance
        Returns:
        the value of the given expression evaluated using the resolver
        See Also:
        VariableResolver
      • evaluateWrapper

        protected Date evaluateWrapper​(Evaluator.VariableWrapper variableWrapper,
                                       Locale locale,
                                       TimeZone tz)
        NOTE: declared as a method to allow for extensibility
        Returns:
        the result of evaluating a string
        WARNING: This API is experimental and might change in incompatible ways in the next release.
        this API is experimental and subject to change
      • evaluateString

        protected Date evaluateString​(String datemathfmt,
                                      Locale locale,
                                      TimeZone tz)
        NOTE: declared as a method to allow for extensibility
        Returns:
        the result of evaluating a string
        WARNING: This API is experimental and might change in incompatible ways in the next release.
      • resolveWrapper

        protected Object resolveWrapper​(Evaluator.VariableWrapper variableWrapper,
                                        Locale locale,
                                        TimeZone tz)
        NOTE: declared as a method to allow for extensibility
        Returns:
        the result of resolving the variable wrapper
        WARNING: This API is experimental and might change in incompatible ways in the next release.