Class DurationValue<DAV extends DurationValue<DAV>>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.value.SimpleValue<V>
-
- org.ow2.authzforce.core.pdp.api.value.StringParseableValue<Duration>
-
- org.ow2.authzforce.core.pdp.api.value.DurationValue<DAV>
-
- Type Parameters:
DAV
- Concrete DurationAttributeValue type subclass
- All Implemented Interfaces:
AttributeValue
,PrimitiveValue
,Value
- Direct Known Subclasses:
DayTimeDurationValue
,YearMonthDurationValue
public abstract class DurationValue<DAV extends DurationValue<DAV>> extends StringParseableValue<Duration>
Superclass of duration attribute values, i.e. XML schema dayTime/yearMonthDuration values. The choice of the Java type Duration is based on JAXB schema-to-Java mapping spec: https://docs.oracle.com/javase/tutorial/jaxb/intro/bind.html and documentation of javax.xml.datatype package.- Version:
- $Id: $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
StringParseableValue.Factory<AV extends AttributeValue>
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
SimpleValue.BaseFactory<AV extends AttributeValue>
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
value
-
-
Constructor Summary
Constructors Constructor Description DurationValue(Duration duration)
Instantiates duration attribute value from string representation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(DAV o)
Compares internal duration value (Duration
) to another, usingDuration.compare(Duration)
String
printXML()
Converts the internal value (accessible viaSimpleValue.getUnderlyingValue()
) to a valid lexical representation for XML marshalling.-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
getXmlAttributes
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
equals, getContent, getUnderlyingValue, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ow2.authzforce.core.pdp.api.value.PrimitiveValue
getXdmItem, getXdmValue
-
-
-
-
Constructor Detail
-
DurationValue
public DurationValue(Duration duration) throws IllegalArgumentException
Instantiates duration attribute value from string representation- Parameters:
duration
- duration- Throws:
IllegalArgumentException
- ifval
is not a valid string representation for this datatype
-
-
Method Detail
-
compare
public final int compare(DAV o) throws IndeterminateEvaluationException
Compares internal duration value (Duration
) to another, usingDuration.compare(Duration)
- Parameters:
o
- compared duration value- Returns:
- result of
Duration.compare(Duration)
- Throws:
IndeterminateEvaluationException
- if and only if result isDatatypeConstants.INDETERMINATE
-
printXML
public final String printXML()
Converts the internal value (accessible viaSimpleValue.getUnderlyingValue()
) to a valid lexical representation for XML marshalling. Equivalent to the 'printMethod' in JAXB 'javaType' binding customizations. Implementations of this typically callDatatypeConverter
. This method is called bySimpleValue.getContent()
and its result cached by the same method for later use. Therefore, no need to cache the result in the implementation.- Specified by:
printXML
in classSimpleValue<Duration>
- Returns:
- XML-valid lexical representation.
-
-