org.apache.solr.handler.dataimport

## Class DateFormatEvaluator

- java.lang.Object
- - org.apache.solr.handler.dataimport.Evaluator
  - - org.apache.solr.handler.dataimport.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)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.solr.handler.dataimport.Evaluator

      `Evaluator.VariableWrapper`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<String,Locale>` | `availableLocales`
    `protected Set<String>` | `availableTimezones`
    `static String` | `DEFAULT_DATE_FORMAT`

    - ### Fields inherited from class org.apache.solr.handler.dataimport.Evaluator

      `DATE_FORMAT_EVALUATOR, ESCAPE_SOLR_QUERY_CHARS, SQL_ESCAPE_EVALUATOR, URL_ENCODE_EVALUATOR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DateFormatEvaluator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `evaluate(String expression, Context context)` Return a String after processing an expression and a `VariableResolver`
    `protected Date` | `evaluateString(String datemathfmt, Locale locale, TimeZone tz)` NOTE: declared as a method to allow for extensibility
    `protected Date` | `evaluateWrapper(Evaluator.VariableWrapper variableWrapper, Locale locale, TimeZone tz)` NOTE: declared as a method to allow for extensibility
    `protected Object` | `resolveWrapper(Evaluator.VariableWrapper variableWrapper, Locale locale, TimeZone tz)` NOTE: declared as a method to allow for extensibility

    - ### Methods inherited from class org.apache.solr.handler.dataimport.Evaluator

      `getVariableWrapper, parseParams`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_DATE_FORMAT

          public static final String DEFAULT_DATE_FORMAT

      See Also:
        Constant Field Values

    - #### availableLocales

          protected Map<String,Locale> availableLocales

    - #### availableTimezones

          protected Set<String> availableTimezones

  - ### 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.

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.