V
- underlying Java value typepublic abstract class SimpleValue<V> extends Object implements AttributeValue
Modifier and Type | Class and Description |
---|---|
static class |
SimpleValue.BaseFactory<AV extends AttributeValue>
Datatype-specific Attribute Value Factory that supports values based on single
Serializable element (i.e. |
Modifier | Constructor and Description |
---|---|
protected |
SimpleValue(V rawVal)
Constructor from Java type of value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<Serializable> |
getContent()
Get the value content as specified by
XmlMixed , i.e. |
V |
getUnderlyingValue()
Returns the internal low-level Java value on which this AttributeValue is based off.
|
int |
hashCode() |
abstract String |
printXML()
Converts the internal value (accessible via
getUnderlyingValue() to a valid lexical representation for XML marshalling. |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getXmlAttributes
protected final V value
protected SimpleValue(V rawVal) throws IllegalArgumentException, NullPointerException
getContent()
The super field 'content' is
set to an empty list but it does not matter, since getContent()
is overridden here to return a singleton list with rawVal
as single value.rawVal
- internal Java native value. MUST NOT be null.IllegalArgumentException
- if rawVal == null
NullPointerException
- if datatypeId == null
public final V getUnderlyingValue()
SimpleValue
implementation if you need to do operations on it.public abstract String printXML()
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 getContent()
and its result cached by the same method for later use.
Therefore, no need to cache the result in the implementation.public final List<Serializable> getContent()
XmlMixed
, i.e. a list, each item of which may be a String, a JAXBElement
, a instance of a class
annotated with @XmlRootElement, or a Element
. In addition, in the two latter cases, the item must also be Serializable
.getContent
in interface AttributeValue
Copyright © 2012–2020. All rights reserved.