Class GlobalTemplateVariables.Date

Enclosing class:
GlobalTemplateVariables

public static class GlobalTemplateVariables.Date extends SimpleTemplateVariableResolver
The date variable evaluates to the current date. This supports a pattern and a locale as optional parameters. pattern is a pattern compatible with SimpleDateFormat. locale is a string representation of the locale compatible with the constructor parameter Locale(String).
  • Constructor Details

    • Date

      public Date()
      Creates a new date variable
  • Method Details

    • resolve

      public void resolve(TemplateVariable variable, TemplateContext context)
      Description copied from class: TemplateVariableResolver
      Resolves variable in context. To resolve means to find a valid binding of the receiver's type in the given TemplateContext. If the variable can be successfully resolved, its value is set using TemplateVariable.setValues(String[]).
      Overrides:
      resolve in class TemplateVariableResolver
      Parameters:
      variable - the variable to resolve
      context - the context in which variable is resolved
    • resolve

      protected String resolve(TemplateContext context)
      Description copied from class: TemplateVariableResolver
      Returns an instance of the type resolved by the receiver available in context. To resolve means to provide a binding to a concrete text object (a String) in the given context.

      The default implementation looks up the type in the context.

      Overrides:
      resolve in class SimpleTemplateVariableResolver
      Parameters:
      context - the context in which to resolve the type
      Returns:
      the name of the text object of this type, or null if it cannot be determined