Obtain a new instance of a Duration
specifying the Duration
as its string representation, "PnYnMnDTnHnMnS", as defined in XML Schema 1.0 section 3.2.6.1.
XML Schema Part 2: Datatypes, 3.2.6 duration, defines duration
as:
duration represents a duration of time. The value space of duration is a six-dimensional space where the coordinates designate the Gregorian year, month, day, hour, minute, and second components defined in Section 5.5.3.2 of [ISO 8601], respectively. These components are ordered in their significance by their order of appearance i.e. as year, month, day, hour, minute, and second.
All six values are set and availabe from the created {@link Duration}
The XML Schema specification states that values can be of an arbitrary size. Implementations may chose not to or be incapable of supporting arbitrarily large and/or small values. An {@link UnsupportedOperationException} will be thrown with a message indicating implementation limitsif implementation capacities are exceeded.
@param lexicalRepresentation
String
representation of a
Duration
.
@return New
Duration
created from parsing the
lexicalRepresentation
.
@throws IllegalArgumentException If
lexicalRepresentation
is not a valid representation of a
Duration
.
@throws UnsupportedOperationException If implementation cannot support requested values.
@throws NullPointerException if
lexicalRepresentation
is
null
.