Class PatternParser

java.lang.Object
com.aquima.interactions.foundation.text.symbol.PatternParser

public class PatternParser extends Object
This parser can be used to parse a date format pattern and use an array of Symbols to construct a DateFormat.
Since:
5.3
Author:
Jon van Leuven
  • Constructor Details

    • PatternParser

      public PatternParser(IDateSymbol[] symbolDefinitions)
      Construct a pattern parser with the symbol defintions that could be used during parsing.
      Parameters:
      symbolDefinitions - Array of all Symbol definitions.
  • Method Details

    • addSymbolDefinition

      public void addSymbolDefinition(IDateSymbol symbol)
      Add a symbol to the definitions.
      Parameters:
      symbol - The symbol.
    • parse

      public IDateSymbol[] parse(String pattern)
      Parse a pattern.
      Parameters:
      pattern - Pattern to parse.
      Returns:
      An array of Symbol representing the parsed pattern.
      Throws:
      PatternException - When unable to parse the pattern.