Class PropertyListConfiguration.DateComponentParser

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DateComponentParser()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkLength​(java.lang.String s, int index, int length)
      Checks whether the given string has at least length characters starting from the given parsing position.
      abstract void formatComponent​(java.lang.StringBuilder buf, java.util.Calendar cal)
      Formats a date component.
      protected void padNum​(java.lang.StringBuilder buf, int num, int length)
      Adds a number to the given string buffer and adds leading '0' characters until the given length is reached.
      abstract int parseComponent​(java.lang.String s, int index, java.util.Calendar cal)
      Parses a component from the given input string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateComponentParser

        private DateComponentParser()
    • Method Detail

      • checkLength

        protected void checkLength​(java.lang.String s,
                                   int index,
                                   int length)
                            throws ParseException
        Checks whether the given string has at least length characters starting from the given parsing position. If this is not the case, an exception will be thrown.
        Parameters:
        s - the string to be tested
        index - the current index
        length - the minimum length after the index
        Throws:
        ParseException - if the string is too short
      • formatComponent

        public abstract void formatComponent​(java.lang.StringBuilder buf,
                                             java.util.Calendar cal)
        Formats a date component. This method is used for converting a date in its internal representation into a string literal.
        Parameters:
        buf - the target buffer
        cal - the calendar with the current date
      • padNum

        protected void padNum​(java.lang.StringBuilder buf,
                              int num,
                              int length)
        Adds a number to the given string buffer and adds leading '0' characters until the given length is reached.
        Parameters:
        buf - the target buffer
        num - the number to add
        length - the required length
      • parseComponent

        public abstract int parseComponent​(java.lang.String s,
                                           int index,
                                           java.util.Calendar cal)
                                    throws ParseException
        Parses a component from the given input string.
        Parameters:
        s - the string to be parsed
        index - the current parsing position
        cal - the calendar where to store the result
        Returns:
        the length of the processed component
        Throws:
        ParseException - if the component cannot be extracted