Class PatternConverterSpec

  • Direct Known Subclasses:
    PatternConverterSpecWithSubpattern

    public class PatternConverterSpec
    extends Object
    Used to parse a single conversion for PatternReader. A conversion is on the format "%[<minlength>][.<maxlength>]<conversion word>[{<parameter>,<parameter>}]".
    Author:
    Johannes Brodwall
    • Method Detail

      • readConversion

        public void readConversion()
      • getMinLength

        public Optional<Integer> getMinLength()
        If the resulting string is shorter than abs(min)-length, it should be padded. If minLength is negative, the string should be right-padded, otherwise, it should be left padded. If minLength is Optional.empty(), output will not be padded.
      • getMaxLength

        public Optional<Integer> getMaxLength()
        If the resulting string is longer than abs(min)-length, it should be truncated. If maxLength is negative, the string should be truncated on the right, otherwise, it should be truncated on the left. If maxLength is Optional.empty(), output will not be truncated.
      • getParameters

        public List<String> getParameters()
        A list of parameters specified in curly brackets after the conversion word. The parameters are separated by , and can optionally by quoted with single quotes ('). For example %date{ 'HH:mm:ss,SSS', Europe/Oslo} has the parameters "HH:mm:ss,SSS" and "Europe/Oslo"
      • readParameters

        public void readParameters()