Package net.sf.saxon.functions
Class ParseIetfDate
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.ParseIetfDate
- All Implemented Interfaces:
Callable
,FunctionItem
,GroundedValue
,Item
,Sequence
This class implements the function parse-ietf-date(), which is a standard function in XPath 3.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall
(XPathContext context, Sequence[] arguments) Evaluate the expressionstatic boolean
isValidTime
(int hour, int minute, int second, int microsecond, int tz) Determine whether a given time is validparse
(String input, XPathContext context) Parse a supplied string to obtain a dateTimeint
Parse part of a string (already tokenized) to obtain a TimeValueMethods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheck
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.FunctionItem
getGenre
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
ParseIetfDate
public ParseIetfDate()
-
-
Method Details
-
call
Evaluate the expression- Specified by:
call
in interfaceCallable
- Parameters:
context
- the dynamic evaluation contextarguments
- 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
Parse a supplied string to obtain a dateTime- Parameters:
input
- a string containing the date and time in IETF formatcontext
- 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(List<String> tokens, int currentPosition, List<TimeValue> result, 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 formatcurrentPosition
- index of current tokenresult
- 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
-