Package org.apache.xmlbeans.impl.values
Class XmlUnionImpl
java.lang.Object
org.apache.xmlbeans.impl.values.XmlObjectBase
org.apache.xmlbeans.impl.values.XmlUnionImpl
- All Implemented Interfaces:
Serializable
,TypeStoreUser
,SimpleValue
,XmlAnySimpleType
,XmlObject
,XmlTokenSource
public class XmlUnionImpl extends XmlObjectBase implements XmlAnySimpleType
This class implements simple union types.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.apache.xmlbeans.impl.values.XmlObjectBase
_voorVc, KIND_SETTERHELPER_ARRAYITEM, KIND_SETTERHELPER_SINGLETON, MAJOR_VERSION_NUMBER, MINOR_VERSION_NUMBER
-
Constructor Summary
Constructors Constructor Description XmlUnionImpl(SchemaType type, boolean complex)
-
Method Summary
Modifier and Type Method Description protected String
compute_text(NamespaceManager nsm)
This should return the canonical string value of the primitive.protected boolean
equal_to(XmlObject xmlobj)
protected int
get_wscanon_rule()
Returns the whitespace rule that will be applied before building a string to pass to get_text().BigDecimal
getBigDecimalValue()
Returns the value as aBigDecimal
.BigInteger
getBigIntegerValue()
Returns the value as aBigInteger
.boolean
getBooleanValue()
Returns the value as a boolean.byte[]
getByteArrayValue()
Returns the value as a byte array.byte
getByteValue()
Returns the value as a byte.Calendar
getCalendarValue()
Returns the value as aCalendar
.Date
getDateValue()
Returns the value as aDate
.double
getDoubleValue()
Returns the value as a double.StringEnumAbstractBase
getEnumValue()
Returns the value as aStringEnumAbstractBase
.float
getFloatValue()
Returns the value as a float.GDate
getGDateValue()
Returns the value as aGDate
.GDuration
getGDurationValue()
Returns the value as aGDuration
.int
getIntValue()
Returns the value as an int.List<?>
getListValue()
Returns the value as aList
of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).long
getLongValue()
Returns the value as a long.QName
getQNameValue()
Returns the value as aQName
.short
getShortValue()
Returns the value as a short.String
getStringValue()
Returns the value as aString
.SchemaType
instanceType()
The same as getSchemaType unless this is a union instance or nil value.protected boolean
is_defaultable_ws(String v)
Types should return false if they don't treat the given whitespace as a default value.SchemaType
schemaType()
protected void
set_b64(byte[] b)
protected void
set_BigDecimal(BigDecimal v)
protected void
set_BigInteger(BigInteger v)
protected void
set_boolean(boolean v)
protected void
set_byte(byte v)
protected void
set_ByteArray(byte[] b)
protected void
set_Calendar(Calendar c)
protected void
set_Date(Date d)
protected void
set_double(double v)
protected void
set_enum(StringEnumAbstractBase e)
protected void
set_float(float v)
protected void
set_GDate(GDateSpecification d)
protected void
set_GDuration(GDurationSpecification d)
protected void
set_hex(byte[] b)
protected void
set_int(int v)
protected void
set_list(List<?> v)
protected void
set_long(long v)
protected void
set_nil()
This should clear the value, and set it to whatever is supposed to be returned when the value is nilled.protected void
set_QName(QName v)
protected void
set_short(short v)
protected void
set_text(String s)
This should set the value of the type from text, or throw an XmlValueOutOfRangeException if it can't.protected void
set_xmldate(XmlObject v)
protected void
set_xmldatetime(XmlObject v)
protected void
set_xmldecimal(XmlObject v)
protected void
set_xmldouble(XmlObject v)
protected void
set_xmlduration(XmlObject v)
protected void
set_xmlfloat(XmlObject v)
protected void
set_xmlgday(XmlObject v)
protected void
set_xmlgmonth(XmlObject v)
protected void
set_xmlgmonthday(XmlObject v)
protected void
set_xmlgyear(XmlObject v)
protected void
set_xmlgyearmonth(XmlObject v)
protected void
set_xmltime(XmlObject v)
protected void
validate_simpleval(String lexical, ValidationContext ctx)
protected int
value_hash_code()
List<? extends XmlAnySimpleType>
xgetListValue()
Returns the value as aList
of XmlAnySimpleType objects.Methods inherited from class org.apache.xmlbeans.impl.values.XmlObjectBase
_copy, _copy, _isComplexContent, _isComplexType, _set, _validateOnSet, attach_store, build_nil, build_text, changeType, check_dated, check_orphaned, compare_to, compareTo, compareValue, copy, copy, create_attribute_user, create_element_user, disconnect_store, documentProperties, dump, elementFlags, equals, execQuery, execQuery, generatedSetterHelperImpl, get_attribute_field, get_attribute_type, get_attributeflags, get_default_attribute_text, get_default_attribute_value, get_default_element_text, get_element_ending_delimiters, get_element_type, get_elementflags, get_schema_type, get_store, get_wscanon_text, getBooleanArray, getBooleanArray, getByteArray, getByteArray, getDomNode, getDoubleArray, getDoubleArray, getEnumArray, getEnumArray, getFloatArray, getFloatArray, getIntArray, getIntArray, getLongArray, getLongArray, getObjectArray, getObjectArray, getObjectValue, getShortArray, getShortArray, getXmlLocale, getXmlObjectArray, getXmlObjectArray, has_store, hashCode, init_flags, initComplexType, invalidate_element_order, invalidate_nilvalue, invalidate_value, is_child_element_order_sensitive, is_orphaned, isDefault, isDefaultable, isFixed, isImmutable, isInstanceOf, isNil, isNillable, java_value, monitor, new_visitor, newCursor, newCursorForce, newDomNode, newDomNode, newInputStream, newInputStream, newReader, newReader, newXMLStreamReader, newXMLStreamReader, save, save, save, save, save, save, save, save, selectAttribute, selectAttribute, selectAttributes, selectChildren, selectChildren, selectChildren, selectPath, selectPath, set, set_char, set_ComplexXml, set_newValue, set_notation, set_String, set_xmlanysimple, setBigDecimalValue, setBigIntegerValue, setBooleanValue, setByteArrayValue, setByteValue, setCalendarValue, setDateValue, setDoubleValue, setEnumValue, setFloatValue, setGDateValue, setGDateValue, setGDurationValue, setGDurationValue, setImmutable, setIntValue, setListValue, setLongValue, setNil, setObjectValue, setQNameValue, setShortValue, setStringValue, setValidateOnSet, substitute, toString, update_from_complex_content, uses_invalidate_value, validate, validate, validate_now, valueEquals, valueHashCode, writeReplace, xgetArray, xgetArray, xmlText, xmlText
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.xmlbeans.XmlObject
changeType, compareTo, compareValue, copy, copy, execQuery, execQuery, isImmutable, isNil, selectAttribute, selectAttribute, selectAttributes, selectChildren, selectChildren, selectChildren, selectPath, selectPath, set, setNil, substitute, toString, validate, validate, valueEquals, valueHashCode
Methods inherited from interface org.apache.xmlbeans.XmlTokenSource
documentProperties, dump, getDomNode, monitor, newCursor, newDomNode, newDomNode, newInputStream, newInputStream, newReader, newReader, newXMLStreamReader, newXMLStreamReader, save, save, save, save, save, save, save, save, xmlText, xmlText
-
Constructor Details
-
Method Details
-
schemaType
- Specified by:
schemaType
in interfaceXmlObject
- Specified by:
schemaType
in classXmlObjectBase
- Returns:
- The schema type for this instance. This is a permanent, unchanging property of the instance.
-
instanceType
Description copied from interface:SimpleValue
The same as getSchemaType unless this is a union instance or nil value.For unions, this returns the non-union consituent type of this instance. This type may change if setters are called that cause the instance to change to another constituent type of the union.
For nil values, this returns null.
- Specified by:
instanceType
in interfaceSimpleValue
- Overrides:
instanceType
in classXmlObjectBase
-
compute_text
Description copied from class:XmlObjectBase
This should return the canonical string value of the primitive. Only called when non-nil.- Specified by:
compute_text
in classXmlObjectBase
-
is_defaultable_ws
Description copied from class:XmlObjectBase
Types should return false if they don't treat the given whitespace as a default value.- Overrides:
is_defaultable_ws
in classXmlObjectBase
-
set_text
Description copied from class:XmlObjectBase
This should set the value of the type from text, or throw an XmlValueOutOfRangeException if it can't.- Specified by:
set_text
in classXmlObjectBase
-
set_nil
protected void set_nil()Description copied from class:XmlObjectBase
This should clear the value, and set it to whatever is supposed to be returned when the value is nilled.- Specified by:
set_nil
in classXmlObjectBase
-
get_wscanon_rule
protected int get_wscanon_rule()Description copied from class:XmlObjectBase
Returns the whitespace rule that will be applied before building a string to pass to get_text().Overridden by subclasses that don't need their text for set_text canonicalized; perhaps they already implement scanners that can deal with whitespace, and they know they have no regex pattern restrictions.
- Overrides:
get_wscanon_rule
in classXmlObjectBase
-
getFloatValue
public float getFloatValue()Description copied from interface:SimpleValue
Returns the value as a float.- Specified by:
getFloatValue
in interfaceSimpleValue
- Overrides:
getFloatValue
in classXmlObjectBase
-
getDoubleValue
public double getDoubleValue()Description copied from interface:SimpleValue
Returns the value as a double.- Specified by:
getDoubleValue
in interfaceSimpleValue
- Overrides:
getDoubleValue
in classXmlObjectBase
-
getBigDecimalValue
Description copied from interface:SimpleValue
Returns the value as aBigDecimal
.- Specified by:
getBigDecimalValue
in interfaceSimpleValue
- Overrides:
getBigDecimalValue
in classXmlObjectBase
-
getBigIntegerValue
Description copied from interface:SimpleValue
Returns the value as aBigInteger
.- Specified by:
getBigIntegerValue
in interfaceSimpleValue
- Overrides:
getBigIntegerValue
in classXmlObjectBase
-
getByteValue
public byte getByteValue()Description copied from interface:SimpleValue
Returns the value as a byte.- Specified by:
getByteValue
in interfaceSimpleValue
- Overrides:
getByteValue
in classXmlObjectBase
-
getShortValue
public short getShortValue()Description copied from interface:SimpleValue
Returns the value as a short.- Specified by:
getShortValue
in interfaceSimpleValue
- Overrides:
getShortValue
in classXmlObjectBase
-
getIntValue
public int getIntValue()Description copied from interface:SimpleValue
Returns the value as an int.- Specified by:
getIntValue
in interfaceSimpleValue
- Overrides:
getIntValue
in classXmlObjectBase
-
getLongValue
public long getLongValue()Description copied from interface:SimpleValue
Returns the value as a long.- Specified by:
getLongValue
in interfaceSimpleValue
- Overrides:
getLongValue
in classXmlObjectBase
-
getByteArrayValue
public byte[] getByteArrayValue()Description copied from interface:SimpleValue
Returns the value as a byte array.- Specified by:
getByteArrayValue
in interfaceSimpleValue
- Overrides:
getByteArrayValue
in classXmlObjectBase
-
getBooleanValue
public boolean getBooleanValue()Description copied from interface:SimpleValue
Returns the value as a boolean.- Specified by:
getBooleanValue
in interfaceSimpleValue
- Overrides:
getBooleanValue
in classXmlObjectBase
-
getCalendarValue
Description copied from interface:SimpleValue
Returns the value as aCalendar
.- Specified by:
getCalendarValue
in interfaceSimpleValue
- Overrides:
getCalendarValue
in classXmlObjectBase
-
getDateValue
Description copied from interface:SimpleValue
Returns the value as aDate
.- Specified by:
getDateValue
in interfaceSimpleValue
- Overrides:
getDateValue
in classXmlObjectBase
-
getGDateValue
Description copied from interface:SimpleValue
Returns the value as aGDate
.- Specified by:
getGDateValue
in interfaceSimpleValue
- Overrides:
getGDateValue
in classXmlObjectBase
-
getGDurationValue
Description copied from interface:SimpleValue
Returns the value as aGDuration
.- Specified by:
getGDurationValue
in interfaceSimpleValue
- Overrides:
getGDurationValue
in classXmlObjectBase
-
getQNameValue
Description copied from interface:SimpleValue
Returns the value as aQName
.- Specified by:
getQNameValue
in interfaceSimpleValue
- Overrides:
getQNameValue
in classXmlObjectBase
-
getListValue
Description copied from interface:SimpleValue
Returns the value as aList
of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).- Specified by:
getListValue
in interfaceSimpleValue
- Overrides:
getListValue
in classXmlObjectBase
-
xgetListValue
Description copied from interface:SimpleValue
Returns the value as aList
of XmlAnySimpleType objects.- Specified by:
xgetListValue
in interfaceSimpleValue
- Overrides:
xgetListValue
in classXmlObjectBase
-
getEnumValue
Description copied from interface:SimpleValue
Returns the value as aStringEnumAbstractBase
.- Specified by:
getEnumValue
in interfaceSimpleValue
- Overrides:
getEnumValue
in classXmlObjectBase
-
getStringValue
Description copied from interface:SimpleValue
Returns the value as aString
.- Specified by:
getStringValue
in interfaceSimpleValue
- Specified by:
getStringValue
in interfaceXmlAnySimpleType
- Overrides:
getStringValue
in classXmlObjectBase
-
set_boolean
protected void set_boolean(boolean v)- Overrides:
set_boolean
in classXmlObjectBase
-
set_byte
protected void set_byte(byte v)- Overrides:
set_byte
in classXmlObjectBase
-
set_short
protected void set_short(short v)- Overrides:
set_short
in classXmlObjectBase
-
set_int
protected void set_int(int v)- Overrides:
set_int
in classXmlObjectBase
-
set_long
protected void set_long(long v)- Overrides:
set_long
in classXmlObjectBase
-
set_float
protected void set_float(float v)- Overrides:
set_float
in classXmlObjectBase
-
set_double
protected void set_double(double v)- Overrides:
set_double
in classXmlObjectBase
-
set_ByteArray
protected void set_ByteArray(byte[] b)- Overrides:
set_ByteArray
in classXmlObjectBase
-
set_hex
protected void set_hex(byte[] b)- Overrides:
set_hex
in classXmlObjectBase
-
set_b64
protected void set_b64(byte[] b)- Overrides:
set_b64
in classXmlObjectBase
-
set_BigInteger
- Overrides:
set_BigInteger
in classXmlObjectBase
-
set_BigDecimal
- Overrides:
set_BigDecimal
in classXmlObjectBase
-
set_QName
- Overrides:
set_QName
in classXmlObjectBase
-
set_Calendar
- Overrides:
set_Calendar
in classXmlObjectBase
-
set_Date
- Overrides:
set_Date
in classXmlObjectBase
-
set_GDate
- Overrides:
set_GDate
in classXmlObjectBase
-
set_GDuration
- Overrides:
set_GDuration
in classXmlObjectBase
-
set_enum
- Overrides:
set_enum
in classXmlObjectBase
-
set_list
- Overrides:
set_list
in classXmlObjectBase
-
set_xmlfloat
-
set_xmldouble
-
set_xmldecimal
-
set_xmlduration
-
set_xmldatetime
-
set_xmltime
-
set_xmldate
-
set_xmlgyearmonth
-
set_xmlgyear
-
set_xmlgmonthday
-
set_xmlgday
-
set_xmlgmonth
-
equal_to
- Specified by:
equal_to
in classXmlObjectBase
-
value_hash_code
protected int value_hash_code()- Specified by:
value_hash_code
in classXmlObjectBase
-
validate_simpleval
- Overrides:
validate_simpleval
in classXmlObjectBase
-