Class ParseIetfDate

    • Constructor Detail

      • ParseIetfDate

        public ParseIetfDate()
    • Method Detail

      • call

        public ZeroOrOne call​(XPathContext context,
                              Sequence[] arguments)
                       throws XPathException
        Evaluate the expression
        Specified by:
        call in interface Callable
        Specified by:
        call in interface Function
        Parameters:
        context - the dynamic evaluation context
        arguments - the values of the arguments, supplied as Sequence objects
        Returns:
        the result of the evaluation, in the form of a Sequence
        Throws:
        XPathException - if a dynamic error occurs during the evaluation of the expression
      • parse

        public DateTimeValue parse​(java.lang.String input,
                                   XPathContext context)
                            throws XPathException
        Parse a supplied string to obtain a dateTime
        Parameters:
        input - a string containing the date and time in IETF format
        context - the XPath context
        Returns:
        either a DateTimeValue representing the input supplied, or a ValidationFailure if the input string was invalid
        Throws:
        XPathException
      • parseTime

        public int parseTime​(java.util.List<java.lang.String> tokens,
                             int currentPosition,
                             java.util.List<TimeValue> result,
                             java.lang.String input)
                      throws XPathException
        Parse part of a string (already tokenized) to obtain a TimeValue
        Parameters:
        tokens - tokenized string containing the date and time in IETF format
        currentPosition - index of current token
        result - TimeValue produced from parsing time from tokens
        Returns:
        index of token after parsing the time
        Throws:
        XPathException
      • isValidTime

        public static boolean isValidTime​(int hour,
                                          int minute,
                                          int second,
                                          int microsecond,
                                          int tz)
        Determine whether a given time is valid
        Parameters:
        hour - the hour (0-24)
        minute - the minute (0-59)
        second - the second (0-59)
        microsecond - the microsecond (0-999999)
        tz - the timezone displacement in minutes from UTC
        Returns:
        true if this is a valid time