TAV
- type of result returned by arithmetic functions with this type of arguments: add(DurationValue)
, subtract(DurationValue)
, etc. Basically, we expect that arithmetic
functions applied to this type T will return a result of the same type T.public abstract class BaseTimeValue<TAV extends BaseTimeValue<TAV>> extends StringParseableValue<XMLGregorianCalendar> implements Comparable<TAV>
XMLGregorianCalendar
is based on JAXB schema-to-Java mapping spec:
https://docs.oracle.com/javase/tutorial/jaxb/intro/bind.htmlStringParseableValue.Factory<AV extends AttributeValue>
SimpleValue.BaseFactory<AV extends AttributeValue>
value
Constructor and Description |
---|
BaseTimeValue(XMLGregorianCalendar val,
QName xsdDatatypeQName)
Instantiate date/time attribute value
|
Modifier and Type | Method and Description |
---|---|
abstract TAV |
add(DurationValue<?> durationVal)
Add duration to this time
|
int |
compareTo(TAV o)
Compares internal date/time value (
XMLGregorianCalendar ) to another, using XMLGregorianCalendar.compare(XMLGregorianCalendar) |
String |
printXML()
Converts the internal value (accessible via
SimpleValue.getUnderlyingValue() to a valid lexical representation for XML marshalling. |
abstract TAV |
subtract(DurationValue<?> durationVal)
Subtract duration to this time
|
getXmlAttributes
equals, getContent, getUnderlyingValue, hashCode, toString
public BaseTimeValue(XMLGregorianCalendar val, QName xsdDatatypeQName) throws IllegalArgumentException
val
- string representation of instance of this datatypexsdDatatypeQName
- Fully qualified name for the date/time W3C XML Schema 1.0 datatype.IllegalArgumentException
- if datatype == null || val == null
public abstract TAV add(DurationValue<?> durationVal)
durationVal
- duration valuepublic abstract TAV subtract(DurationValue<?> durationVal)
durationVal
- duration valuepublic final int compareTo(TAV o) throws IllegalArgumentException
XMLGregorianCalendar
) to another, using XMLGregorianCalendar.compare(XMLGregorianCalendar)
compareTo
in interface Comparable<TAV extends BaseTimeValue<TAV>>
IllegalArgumentException
public final String printXML()
SimpleValue.getUnderlyingValue()
to a valid lexical representation for XML marshalling. Equivalent to the 'printMethod' in JAXB 'javaType' binding
customizations. Implementations of this typically call DatatypeConverter
. This method is called by SimpleValue.getContent()
and its result cached by the same method for later use.
Therefore, no need to cache the result in the implementation.printXML
in class SimpleValue<XMLGregorianCalendar>
Copyright © 2012–2020. All rights reserved.