Class FormatConfig

  • Direct Known Subclasses:
    BrowserTool, DateTool, MathTool, NumberTool

    public class FormatConfig
    extends LocaleConfig
    Implements common logic and constants for tools which allow their default format to be configured.
    Since:
    VelocityTools 2.0
    Author:
    Nathan Bubna
    • Field Detail

      • DEFAULT_FORMAT

        public static final java.lang.String DEFAULT_FORMAT
        The default format to be used when none is specified.
        See Also:
        Constant Field Values
      • FORMAT_KEY

        public static final java.lang.String FORMAT_KEY
        The key used for specifying a default format via tool configuration.
        See Also:
        Constant Field Values
      • format

        private java.lang.String format
    • Constructor Detail

      • FormatConfig

        public FormatConfig()
    • Method Detail

      • configure

        protected void configure​(ValueParser values)
        Does the actual configuration. This is protected, so subclasses may share the same ValueParser and call configure at any time, while preventing templates from doing so when configure(Map) is locked.
        Overrides:
        configure in class LocaleConfig
      • getFormat

        public java.lang.String getFormat()
        This returns the configured default format for this tool.
        Returns:
        the default String
      • setFormat

        protected void setFormat​(java.lang.String format)
        Sets the default format for this instance.