Class DateResolver


  • public class DateResolver
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DateResolver()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Calendar date​(Field f)
      Gets the date of the given field by reading it's components pattern.
      static java.util.List<java.util.Calendar> dates​(Field f)
      Gets the dates of the given field by reading it's components pattern.
      • Methods inherited from class java.lang.Object

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

      • DateResolver

        public DateResolver()
    • Method Detail

      • dates

        public static java.util.List<java.util.Calendar> dates​(Field f)
        Gets the dates of the given field by reading it's components pattern. All index of 'D', 'E', 'F', 'Y', 'A', 'U', 'P' or 'J' in the pattern are looked for and returned as calendar. See the returns notes
        Parameters:
        f - the field where to extract the dates, must not be null
        Returns:
        a list of Calendar with the dates found in the dates components or an empty list if none is found. Missing or invalid dates components are returned as null; meaning if a components expected to be a date is not present or it is not a valid date or Field.getComponent(index, Calendar.class) fails, that component is still included in the result list as a null value.
        See Also:
        Field.getComponentAs(int, Class)
      • date

        public static java.util.Calendar date​(Field f)
        Gets the date of the given field by reading it's components pattern. The first index of 'D', 'E', 'F', 'Y', 'A', 'U', 'P' or 'J', is returned as a calendar. See the returns notes
        Parameters:
        f - the field where to extract the date, must not be null
        Returns:
        a Calendar with the date found in the first date component or null if there is no date component in the field. It may also return null if the date is not valid
        Since:
        7.8