Class XmlObjectBase
- All Implemented Interfaces:
Serializable,TypeStoreUser,SimpleValue,XmlObject,XmlTokenSource
- Direct Known Subclasses:
JavaBase64Holder,JavaBooleanHolder,JavaDecimalHolder,JavaDoubleHolder,JavaFloatHolder,JavaGDateHolderEx,JavaGDurationHolderEx,JavaHexBinaryHolder,JavaIntegerHolder,JavaIntHolder,JavaLongHolder,JavaQNameHolder,JavaStringHolder,JavaUriHolder,XmlAnySimpleTypeImpl,XmlComplexContentImpl,XmlListImpl,XmlUnionImpl
public abstract class XmlObjectBase extends Object implements TypeStoreUser, Serializable, XmlObject, SimpleValue
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static ValidationContext_voorVcstatic shortKIND_SETTERHELPER_ARRAYITEMstatic shortKIND_SETTERHELPER_SINGLETONstatic shortMAJOR_VERSION_NUMBERstatic shortMINOR_VERSION_NUMBER -
Constructor Summary
Constructors Modifier Constructor Description protectedXmlObjectBase() -
Method Summary
Modifier and Type Method Description XmlObject_copy()Same as copy() but unsynchronized.XmlObject_copy(XmlOptions xmlOptions)Same as copy() but unsynchronized.protected boolean_isComplexContent()protected boolean_isComplexType()XmlObject_set(XmlObject src)Same as set() but unsynchronized.protected boolean_validateOnSet()voidattach_store(TypeStore store)Called to initialize the TypeStore associated with this XmlObject implementation.booleanbuild_nil()A store will call back on build_nil after we've called invalidate_nil and it needs to know what the nil value is.Stringbuild_text(NamespaceManager nsm)Called by a TypeStore to pull out the most reasonable text value from us.XmlObjectchangeType(SchemaType type)Changes the schema type associated with this data and returns a new XmlObject instance whose schemaType is the new type.voidcheck_dated()Called prior to every get operation, to ensure that the value being read is valid.protected voidcheck_orphaned()Called before every getter and setter on the strongly typed classes to ensure that the object has not been orphaned.protected intcompare_to(XmlObject xmlobj)This implementation of compare_to is allowed to do two unusual things: (1) it can assume that the xmlobj passed has a primitive type underlying the instance type that matches the current instance, and that neither is nil.intcompareTo(Object obj)Implements Comparable.intcompareValue(XmlObject xmlobj)This comparison method is similar to compareTo, but rather than throwing a ClassCastException when two values are incomparable, it returns the number 2.protected abstract Stringcompute_text(NamespaceManager nsm)This should return the canonical string value of the primitive.XmlObjectcopy()Returns a deep copy of this XmlObject.XmlObjectcopy(XmlOptions options)Returns a deep copy of this XmlObject.TypeStoreUsercreate_attribute_user(QName attrName)A typestore user can create a new TypeStoreUser instance for a given attribute child, based on the attribute name.TypeStoreUsercreate_element_user(QName eltName, QName xsiType)A typestore user can create a new TypeStoreUser instance for a given element child name as long as you also pass the qname contained by the xsi:type attribute, if any.voiddisconnect_store()A store calls back here in order to force a disconnect.XmlDocumentPropertiesdocumentProperties()Returns the XmlDocumentProperties object for the document this token source is associated with.voiddump()Prints to stdout the state of the document in which this token source is positioned.protected intelementFlags()Used for situations where these flags must be passed on to chained values.protected abstract booleanequal_to(XmlObject xmlobj)booleanequals(Object obj)XmlObject[]execQuery(String path)Executes a query.XmlObject[]execQuery(String queryExpr, XmlOptions options)Executes a query with options.XmlObjectgeneratedSetterHelperImpl(XmlObject src, QName propName, int index, short kindSetterHelper)SchemaFieldget_attribute_field(QName attrName)Returns the schema field for an attributeSchemaTypeget_attribute_type(QName attrName)Return the SchemaType which an attribute of this name would be.intget_attributeflags(QName attrName)Returns the flags for the given attribute.Stringget_default_attribute_text(QName attrName)Returns the default attribute text for the attribute with the given name, or null if no default.protected XmlAnySimpleTypeget_default_attribute_value(QName name)Called by code generated code to get the default attribute value for a given attribute name, or null if none.Stringget_default_element_text(QName eltName)Returns the default element text, if it's consistent.QNameSetget_element_ending_delimiters(QName eltname)Inserting a new element is always unambiguous except in one situation: when adding an element after the last one with that name (or the first one if there are none).SchemaTypeget_element_type(QName eltName, QName xsiType)Return the SchemaType which a child element of this name and xsi:type would be.intget_elementflags(QName eltName)Returns the elementflags, if they're consistent.SchemaTypeget_schema_type()Returns the schema type of this userTypeStoreget_store()Used by the ComplexTypeImpl subclass to get direct access to the store.protected intget_wscanon_rule()Returns the whitespace rule that will be applied before building a string to pass to get_text().Stringget_wscanon_text()Grabs the undelying litral representation, applying the implementation's wscanon rule.BigDecimalgetBigDecimalValue()Returns the value as aBigDecimal.BigIntegergetBigIntegerValue()Returns the value as aBigInteger.protected boolean[]getBooleanArray(QName elementName)protected boolean[]getBooleanArray(QNameSet elementSet)booleangetBooleanValue()Returns the value as a boolean.protected byte[]getByteArray(QName elementName)protected byte[]getByteArray(QNameSet elementSet)byte[]getByteArrayValue()Returns the value as a byte array.bytegetByteValue()Returns the value as a byte.CalendargetCalendarValue()Returns the value as aCalendar.DategetDateValue()Returns the value as aDate.NodegetDomNode()Returns a W3C DOM Node containing the XML represented by this source.protected double[]getDoubleArray(QName elementName)protected double[]getDoubleArray(QNameSet elementSet)doublegetDoubleValue()Returns the value as a double.protected <T> T[]getEnumArray(QName elementName, IntFunction<T[]> arrayCon)protected <T> T[]getEnumArray(QNameSet elementSet, IntFunction<T[]> arrayCon)StringEnumAbstractBasegetEnumValue()Returns the value as aStringEnumAbstractBase.protected float[]getFloatArray(QName elementName)protected float[]getFloatArray(QNameSet elementSet)floatgetFloatValue()Returns the value as a float.GDategetGDateValue()Returns the value as aGDate.GDurationgetGDurationValue()Returns the value as aGDuration.protected int[]getIntArray(QName elementName)protected int[]getIntArray(QNameSet elementSet)intgetIntValue()Returns the value as an int.List<?>getListValue()Returns the value as aListof friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).protected long[]getLongArray(QName elementName)protected long[]getLongArray(QNameSet elementSet)longgetLongValue()Returns the value as a long.protected <T> T[]getObjectArray(QName elementName, Function<SimpleValue,T> fun, IntFunction<T[]> arrayCon)protected <T> T[]getObjectArray(QNameSet elementSet, Function<SimpleValue,T> fun, IntFunction<T[]> arrayCon)ObjectgetObjectValue()Returns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).QNamegetQNameValue()Returns the value as aQName.protected short[]getShortArray(QName elementName)protected short[]getShortArray(QNameSet elementSet)shortgetShortValue()Returns the value as a short.StringgetStringValue()Returns the value as aString.XmlLocalegetXmlLocale()protected <T extends XmlObject>
T[]getXmlObjectArray(QName elementName, T[] arrayCon)protected <T extends XmlObject>
T[]getXmlObjectArray(QNameSet elementSet, T[] arrayCon)protected booleanhas_store()inthashCode()voidinit_flags(SchemaProperty prop)protected voidinitComplexType(boolean complexType, boolean complexContent)Called by restriction subclasses within their constructors to enable complex type support.SchemaTypeinstanceType()The same as getSchemaType unless this is a union instance or nil value.voidinvalidate_element_order()Called by a TypeStore to indicate that the element's default value, nillability, fixedness, etc, may have changed by virtue of the element order changing (and xsi:nil and the text may have changed too); so the store should be consulted next time any setter or getter is called.voidinvalidate_nilvalue()Called by a TypeStore to indicate that the xsi:nil attribute on the containing element (and possibly the text) has been invalidated and both should be consulted next time the value is needed.voidinvalidate_value()Called by a TypeStore to indicate that the text has been invalidated and should be fetched next time the value is needed.booleanis_child_element_order_sensitive()Returns false if child elements are insensitive to order; if it returns true, you're required to call invalidate_element_order on children to the right of any child order rearrangement.protected booleanis_defaultable_ws(String v)Types should return false if they don't treat the given whitespace as a default value.protected booleanis_orphaned()Describes the orphaned status of this object.booleanisDefault()True if the value is currently defaulted.booleanisDefaultable()True if the value is currently defaulted.booleanisFixed()True if the value is fixed.booleanisImmutable()Is this instance an immutable value?booleanisInstanceOf(SchemaType type)booleanisNil()True if the value is nilled.booleanisNillable()True if the value is allowed to be nil.protected static Objectjava_value(XmlObject obj)Objectmonitor()Returns the synchronization object for the document.TypeStoreVisitornew_visitor()A typestore user can return a visitor that is used to compute default text and elementflags for an arbitrary element.XmlCursornewCursor()Returns a new XML cursor.XmlCursornewCursorForce()NodenewDomNode()Returns a W3C DOM Node containing the XML represented by this source.NodenewDomNode(XmlOptions options)Just like newDomNode() but with options.InputStreamnewInputStream()Returns a new stream containing standard XML text, encoded according to the given encoding.InputStreamnewInputStream(XmlOptions options)Just like newInputStream(String encoding) but with options.ReadernewReader()Returns a new character reader containing XML text.ReadernewReader(XmlOptions options)Just like newReader() but with options.XMLStreamReadernewXMLStreamReader()Returns a new XMLStreamReader.XMLStreamReadernewXMLStreamReader(XmlOptions options)Returns a new XMLStreamReader.voidsave(File file)Writes the XML represented by this source to the given File.voidsave(File file, XmlOptions options)Writes the XML represented by this source to the given File.voidsave(OutputStream os)Writes the XML represented by this source to the given output stream.voidsave(OutputStream os, XmlOptions options)Writes the XML represented by this source to the given output stream.voidsave(Writer w)Writes the XML represented by this source to the given output.voidsave(Writer w, XmlOptions options)Writes the XML represented by this source to the given output.voidsave(ContentHandler ch, LexicalHandler lh)Writes the XML represented by this source to the given SAX content and lexical handlers.voidsave(ContentHandler ch, LexicalHandler lh, XmlOptions options)Writes the XML represented by this source to the given SAX content and lexical handlers.abstract SchemaTypeschemaType()XmlObjectselectAttribute(String attributeUri, String attributeLocalName)Selects the content of the attribute with the given name.XmlObjectselectAttribute(QName attributeName)Selects the content of the attribute with the given name.XmlObject[]selectAttributes(QNameSet attributeNameSet)Selects the contents of the attributes that are contained in the elementNameSet.XmlObject[]selectChildren(String elementUri, String elementLocalName)Selects the contents of the children elements with the given name.XmlObject[]selectChildren(QName elementName)Selects the contents of the children elements with the given name.XmlObject[]selectChildren(QNameSet elementNameSet)Selects the contents of the children elements that are contained in the elementNameSet.XmlObject[]selectPath(String path)Selects a path.XmlObject[]selectPath(String path, XmlOptions options)Selects a path, applying options.XmlObjectset(XmlObject src)Set the value/type of this XmlObject to be a copy of the source XmlObject.protected voidset_b64(byte[] b)protected voidset_BigDecimal(BigDecimal v)protected voidset_BigInteger(BigInteger v)protected voidset_boolean(boolean v)protected voidset_byte(byte v)protected voidset_ByteArray(byte[] b)protected voidset_Calendar(Calendar v)protected voidset_char(char v)protected voidset_ComplexXml(XmlObject v)protected voidset_Date(Date v)protected voidset_double(double v)protected voidset_enum(StringEnumAbstractBase e)protected voidset_float(float v)protected voidset_GDate(GDateSpecification v)protected voidset_GDuration(GDurationSpecification v)protected voidset_hex(byte[] b)protected voidset_int(int v)protected voidset_list(List<?> list)protected voidset_long(long v)voidset_newValue(XmlObject obj)protected abstract voidset_nil()This should clear the value, and set it to whatever is supposed to be returned when the value is nilled.protected voidset_notation(String v)protected voidset_QName(QName v)protected voidset_short(short v)protected voidset_String(String v)Setting a string preserves any noncanonical literal representation.protected abstract voidset_text(String text)This should set the value of the type from text, or throw an XmlValueOutOfRangeException if it can't.protected voidset_xmlanysimple(XmlAnySimpleType v)voidsetBigDecimalValue(BigDecimal obj)Sets the value as aBigDecimal.voidsetBigIntegerValue(BigInteger obj)Sets the value as aBigInteger.voidsetBooleanValue(boolean v)Sets the value as a boolean.voidsetByteArrayValue(byte[] obj)Sets the value as a byte array.voidsetByteValue(byte v)Sets the value as a byte.voidsetCalendarValue(Calendar obj)Sets the value as aCalendar.voidsetDateValue(Date obj)Sets the value as aDate.voidsetDoubleValue(double v)Sets the value as a double.voidsetEnumValue(StringEnumAbstractBase obj)Sets the value as aStringEnumAbstractBase.voidsetFloatValue(float v)Sets the value as a float.voidsetGDateValue(GDate obj)Sets the value as aGDate.voidsetGDateValue(GDateSpecification obj)voidsetGDurationValue(GDuration obj)Sets the value as aGDuration.voidsetGDurationValue(GDurationSpecification obj)voidsetImmutable()Used to make a free-standing xml simple value instance immutable.voidsetIntValue(int v)Sets the value as an int.voidsetListValue(List<?> obj)Sets the value as aList.voidsetLongValue(long v)Sets the value as a long.voidsetNil()Nils the value.voidsetObjectValue(Object o)Sets the value as an arbitraryObject.voidsetQNameValue(QName obj)Sets the value as aQName.voidsetShortValue(short v)Sets the value as a short.voidsetStringValue(String obj)Sets the value as aString.voidsetValidateOnSet()XmlObjectsubstitute(QName name, SchemaType type)Changes the schema type associated with this data using substitution groups and returns an XmlObject instance whose schemaType is the new type and container name is the new name.StringtoString()The string is pretty-printed.protected voidupdate_from_complex_content()Update the value based on complex content.booleanuses_invalidate_value()A store can call uses_invalidate_value to know if calls to invalidate_value will be fruitful.booleanvalidate()Does a deep validation of the entire subtree under the object, but does not validate the parents or siblings of the object if the object is in the interior of an xml tree.booleanvalidate(XmlOptions options)Just like validate(), but with options.voidvalidate_now()A store will call back on validate_now to force us to look at the text if we're in an invalid state.protected voidvalidate_simpleval(String lexical, ValidationContext ctx)protected abstract intvalue_hash_code()booleanvalueEquals(XmlObject xmlobj)True if the xml values are equal.intvalueHashCode()ObjectwriteReplace()This method can writeReplace either an unwrapped XmlObjectBase or an XBean proxy.protected <T extends XmlObject>
T[]xgetArray(QName elementName, IntFunction<T[]> arrayCon)protected <T extends XmlObject>
T[]xgetArray(QNameSet elementSet, IntFunction<T[]> arrayCon)List<? extends XmlAnySimpleType>xgetListValue()Returns the value as aListof XmlAnySimpleType objects.StringxmlText()Returns standard XML text.StringxmlText(XmlOptions options)Just like xmlText() but with options.
-
Field Details
-
MAJOR_VERSION_NUMBER
public static final short MAJOR_VERSION_NUMBER- See Also:
- Constant Field Values
-
MINOR_VERSION_NUMBER
public static final short MINOR_VERSION_NUMBER- See Also:
- Constant Field Values
-
KIND_SETTERHELPER_SINGLETON
public static final short KIND_SETTERHELPER_SINGLETON- See Also:
- Constant Field Values
-
KIND_SETTERHELPER_ARRAYITEM
public static final short KIND_SETTERHELPER_ARRAYITEM- See Also:
- Constant Field Values
-
_voorVc
-
-
Constructor Details
-
XmlObjectBase
protected XmlObjectBase()
-
-
Method Details
-
monitor
Description copied from interface:XmlTokenSourceReturns the synchronization object for the document. If concurrent multithreaded access to a document is required, the access should should be protected by synchronizing on this monitor() object. There is one monitor per XML document tree.- Specified by:
monitorin interfaceXmlTokenSource
-
copy
Description copied from interface:XmlObjectReturns a deep copy of this XmlObject. The returned object has the same type as the current object, and has all the content of the XML document underneath the current object. Note that any parts of the XML document above or outside this XmlObject are not copied.Note: The result object will be in the same synchronization domain as the source, and additional synchronization is required for concurrent access. To use a different synchronization domain use setCopyUseNewSynchronizationDomain option with copy(XmlOptions) method.
- Specified by:
copyin interfaceXmlObject- See Also:
XmlObject.copy(XmlOptions),XmlOptions.setCopyUseNewSynchronizationDomain(boolean)
-
copy
Description copied from interface:XmlObjectReturns a deep copy of this XmlObject. The returned object has the same type as the current object, and has all the content of the XML document underneath the current object. Note that any parts of the XML document above or outside this XmlObject are not copied.Note: The result object will be in the same synchronization domain as the source, and additional synchronization is required for concurrent access. To use a different synchronization domain use setCopyUseNewSynchronizationDomain option when creating the original XmlObject.
- Specified by:
copyin interfaceXmlObject- See Also:
XmlOptions.setCopyUseNewSynchronizationDomain(boolean)
-
_copy
Same as copy() but unsynchronized. Warning: Using this method in mutithreaded environment can cause invalid states. -
_copy
Same as copy() but unsynchronized. If Locale.COPY_USE_NEW_LOCALE is set in the options, a new locale will be created for the copy. Warning: Using this method in mutithreaded environment can cause invalid states. -
documentProperties
Description copied from interface:XmlTokenSourceReturns the XmlDocumentProperties object for the document this token source is associated with.- Specified by:
documentPropertiesin interfaceXmlTokenSource
-
newXMLStreamReader
Description copied from interface:XmlTokenSourceReturns a new XMLStreamReader.The stream starts at the current begin-tag or begin-document position and ends at the matching end-tag or end-document.
This is a fail-fast stream, so if the underlying data is changed while the stream is being read, the stream throws a ConcurrentModificationException.
- Specified by:
newXMLStreamReaderin interfaceXmlTokenSource
-
newXMLStreamReader
Description copied from interface:XmlTokenSourceReturns a new XMLStreamReader.The stream starts at the current begin-tag or begin-document position and ends at the matching end-tag or end-document.
This is a fail-fast stream, so if the underlying data is changed while the stream is being read, the stream throws a ConcurrentModificationException.
Throws an IllegalStateException if the XmlTokenSource is not positioned at begin-tag or begin-document (e.g., if it is at an attribute).
To specify this Use this method The character encoding to use when converting the character data in the XML to bytess. XmlOptions.setCharacterEncoding(java.lang.String)Prefix-to-namespace mappings that should be assumed when saving this XML. This is useful when the resulting XML will be part of a larger XML document, ensuring that this inner document will take advantage of namespaces defined in the outer document. XmlOptions.setSaveImplicitNamespaces(java.util.Map<java.lang.String, java.lang.String>)Suggested namespace prefixes to use when saving. Used only when a namespace attribute needs to be synthesized. XmlOptions.setSaveSuggestedPrefixes(java.util.Map<java.lang.String, java.lang.String>)That namespace attributes should occur first in elements when the XML is saved. By default, they occur last. XmlOptions.setSaveNamespacesFirst()The XML should be pretty printed when saved. Note that this should only be used for debugging. XmlOptions.setSavePrettyPrint()The number of spaces to use when indenting for pretty printing. The default is 2. XmlOptions.setSavePrettyPrintIndent(int)The additional number of spaces indented from the left for pretty printed XML. XmlOptions.setSavePrettyPrintOffset(int)To minimize the number of namespace attributes generated for the saved XML. Note that this can reduce performance significantly. XmlOptions.setSaveAggressiveNamespaces()To reduce the size of the saved document by allowing the use of the default namespace. Note that this can potentially change the semantic meaning of the XML if unprefixed QNames are present as the value of an attribute or element. XmlOptions.setUseDefaultNamespace()To filter out processing instructions with the specified target name. XmlOptions.setSaveFilterProcinst(java.lang.String)Change the QName of the synthesized root element when saving. This replaces "xml-fragment" with "fragment" in the namespace http://www.openuri.org/fragment XmlOptions.setSaveUseOpenFrag()Saving should begin on the element's contents. XmlOptions.setSaveInner()Saving should begin on the element, rather than its contents. XmlOptions.setSaveOuter()To rename the document element, or to specify the document element for this XML. XmlOptions.setSaveSyntheticDocumentElement(javax.xml.namespace.QName)- Specified by:
newXMLStreamReaderin interfaceXmlTokenSource- Parameters:
options- Any of the described options. Options map may be null.- Returns:
- A new validating XMLStreamReader.
- See Also:
XmlOptions
-
newInputStream
Description copied from interface:XmlTokenSourceReturns a new stream containing standard XML text, encoded according to the given encoding.The byte stream contains contents starting at the current begin-tag or begin-document and ending at the matching end-tag or end-document. The specified encoding is used and also emitted in a PI at the beginning of the stream.
This is a fail-fast stream, so if the underlying data is changed while the stream is being read, the stream throws a ConcurrentModificationException.
Throws an IllegalStateException if the XmlTokenSource is not positioned at begin-tag or begin-document (e.g., if it is at an attribute).
- Specified by:
newInputStreamin interfaceXmlTokenSource
-
newInputStream
Description copied from interface:XmlTokenSourceJust like newInputStream(String encoding) but with options. Options map may be null.- Specified by:
newInputStreamin interfaceXmlTokenSource- See Also:
XmlOptions
-
newReader
Description copied from interface:XmlTokenSourceReturns a new character reader containing XML text.The contents of the reader represents the document contents starting at the current begin-tag or begin-document and ending at the matching end-tag or end-document. No encoding annotation will be made in the text itself.
This is a fail-fast reader, so if the underlying data is changed while the reader is being read, the reader throws a ConcurrentModificationException.
Throws an IllegalStateException if the XmlTokenSource is not positioned at begin-tag or begin-document (e.g., if it is at an attribute).
- Specified by:
newReaderin interfaceXmlTokenSource
-
newReader
Description copied from interface:XmlTokenSourceJust like newReader() but with options. Options map may be null.- Specified by:
newReaderin interfaceXmlTokenSource- See Also:
XmlOptions
-
getDomNode
Description copied from interface:XmlTokenSourceReturns a W3C DOM Node containing the XML represented by this source. This is a live DOM node, not a copy. Any changes made through this node are immediately reflected in the document associated with this token source. Depending on the kind of token this XmlTokenSource represents, an appropriate node will be returned.- Specified by:
getDomNodein interfaceXmlTokenSource
-
newDomNode
Description copied from interface:XmlTokenSourceReturns a W3C DOM Node containing the XML represented by this source. This is a copy of the XML, it is not a live with the underlying store of this token source. If this is the document node, then a Document is returned, else a DocumentFragment is returned.- Specified by:
newDomNodein interfaceXmlTokenSource
-
newDomNode
Description copied from interface:XmlTokenSourceJust like newDomNode() but with options. Options map may be null.- Specified by:
newDomNodein interfaceXmlTokenSource- See Also:
XmlOptions
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given SAX content and lexical handlers. Note that this method does not save the XML declaration, including the encoding information. To save the XML declaration with the XML, seeXmlTokenSource.save(OutputStream),XmlTokenSource.save(OutputStream, XmlOptions),XmlTokenSource.save(File)orXmlTokenSource.save(File, XmlOptions).- Specified by:
savein interfaceXmlTokenSource- Throws:
SAXException
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given File. This method will save the XML declaration, including encoding information, with the XML.- Specified by:
savein interfaceXmlTokenSource- Throws:
IOException
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given output stream. This method will save the XML declaration, including encoding information, with the XML.- Specified by:
savein interfaceXmlTokenSource- Throws:
IOException
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given output. Note that this method does not save the XML declaration, including the encoding information. To save the XML declaration with the XML, seeXmlTokenSource.save(OutputStream),XmlTokenSource.save(OutputStream, XmlOptions),XmlTokenSource.save(File)orXmlTokenSource.save(File, XmlOptions).- Specified by:
savein interfaceXmlTokenSource- Throws:
IOException
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given SAX content and lexical handlers. Note that this method does not save the XML declaration, including the encoding information. To save the XML declaration with the XML, seeXmlTokenSource.save(OutputStream),XmlTokenSource.save(OutputStream, XmlOptions),XmlTokenSource.save(File)orXmlTokenSource.save(File, XmlOptions).- Specified by:
savein interfaceXmlTokenSource- Throws:
SAXException
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given File. This method will save the XML declaration, including encoding information, with the XML.- Specified by:
savein interfaceXmlTokenSource- Throws:
IOException
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given output stream. This method will save the XML declaration, including encoding information, with the XML.- Specified by:
savein interfaceXmlTokenSource- Throws:
IOException
-
save
Description copied from interface:XmlTokenSourceWrites the XML represented by this source to the given output. Note that this method does not save the XML declaration, including the encoding information. To save the XML declaration with the XML, seeXmlTokenSource.save(OutputStream),XmlTokenSource.save(OutputStream, XmlOptions),XmlTokenSource.save(File)orXmlTokenSource.save(File, XmlOptions).- Specified by:
savein interfaceXmlTokenSource- Throws:
IOException
-
dump
public void dump()Description copied from interface:XmlTokenSourcePrints to stdout the state of the document in which this token source is positioned. This is very implementation specific and may change at any time. Dump can be useful for debugging purposes. It is very different from the save methods which produce XML text which only approximates the actual state of the document.- Specified by:
dumpin interfaceXmlTokenSource
-
newCursorForce
-
newCursor
Description copied from interface:XmlTokenSourceReturns a new XML cursor.A cursor provides random access to all the tokens in the XML data, plus the ability to extract strongly-typed XmlObjects for the data. If the data is not read-only, the XML cursor also allows modifications to the data.
Using a cursor for the first time typically forces the XML document into memory.
- Specified by:
newCursorin interfaceXmlTokenSource
-
schemaType
- Specified by:
schemaTypein interfaceXmlObject- Returns:
- The schema type for this instance. This is a permanent, unchanging property of the instance.
-
instanceType
Description copied from interface:SimpleValueThe 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:
instanceTypein interfaceSimpleValue
-
validate
public boolean validate()Description copied from interface:XmlObjectDoes a deep validation of the entire subtree under the object, but does not validate the parents or siblings of the object if the object is in the interior of an xml tree. -
validate
Description copied from interface:XmlObjectJust like validate(), but with options.
If you wish to collect error messages and locations while validating, use the
XmlOptions.setErrorListener(java.util.Collection<org.apache.xmlbeans.XmlError>)method. With that method, you can specify an object in which to store messages related to validation. The following is a simple example.// Create an XmlOptions instance and set the error listener. XmlOptions validateOptions = new XmlOptions(); ArrayList errorList = new ArrayList(); validateOptions.setErrorListener(errorList); // Validate the XML. boolean isValid = newEmp.validate(validateOptions); // If the XML isn't valid, loop through the listener's contents, // printing contained messages. if (!isValid) { for (int i = 0; i < errorList.size(); i++) { XmlError error = (XmlError)errorList.get(i); System.out.println("\n"); System.out.println("Message: " + error.getMessage() + "\n"); System.out.println("Location of invalid XML: " + error.getCursorLocation().xmlText() + "\n"); } }- Specified by:
validatein interfaceXmlObject- Parameters:
options- An object that implements theCollectioninterface.- Returns:
- true if the contents of this object are valid according to schemaType().
-
validate_simpleval
-
selectPath
Description copied from interface:XmlObjectSelects a path. Path can be a string or precompiled path String.The path must be a relative path, where "." represents the element or attribute containing this XmlObject, and it must select only other elements or attributes. If a non-element or non-attribute is selected, an unchecked exception is thrown.
The array that is returned contains all the selected XmlObjects, within the same document, listed in document order. The actual array type of the result is inferred from the closest common base type of selected results.
Here is an example of usage. Suppose we have a global element definition for "owner" whose type is "person":
<schema targetNamespace="http://openuri.org/sample"> <element name="owner" type="person"/> <complexType name="person"> [...] </complexType> </schema>and suppose "owner" tags can be scattered throughout the document. Then we can write the following code to find them all:
import org.openuri.sample.Person; import org.apache.xmlbeans.*; [...] XmlObject xobj = XmlObject.Factory.parse(myFile); Person[] results; results = (Person[])xobj.selectPath( "declare namespace s='http://www.openuri.org/sample' " + ".//s:owner");Notice the way in which namespace declarations are done in XPath 2.0. Since XPath can only navigate within an XML document - it cannot construct new XML - the resulting XmlObjects all reside in the same XML document as this XmlObject itself.
- Specified by:
selectPathin interfaceXmlObject- Parameters:
path- the xpath- Returns:
- an array of all selected XmlObjects
-
selectPath
Description copied from interface:XmlObjectSelects a path, applying options.- Specified by:
selectPathin interfaceXmlObject- Parameters:
path- the xpathoptions- the options used to execute the xpath- Returns:
- an array of all selected XmlObjects
- See Also:
XmlObject.selectPath(String)
-
execQuery
Description copied from interface:XmlObjectExecutes a query. Query can be a string or precompiled query String.An XQuery is very similar to an XPath, except that it also permits construction of new XML. As a result, the XmlObjects that are returned from execQuery are in newly created documents, separate from the XmlObject on which the query is executed.
Syntax and usage is otherwise similar to selectPath.
- Specified by:
execQueryin interfaceXmlObject- Parameters:
path- The XQuery expression- Returns:
- an array of all selected XmlObjects
- See Also:
XmlObject.selectPath(String)
-
execQuery
Description copied from interface:XmlObjectExecutes a query with options.Use the options parameter to specify the following:
To specify this Use this method The document type for the root element. XmlOptions.setDocumentType(org.apache.xmlbeans.SchemaType)To replace the document element with the specified QName when constructing the resulting document. XmlOptions.setLoadReplaceDocumentElement(javax.xml.namespace.QName)To strip all insignificant whitespace when constructing a document. XmlOptions.setLoadStripWhitespace()To strip all comments when constructing a document. XmlOptions.setLoadStripComments()To strip all processing instructions when constructing a document. XmlOptions.setLoadStripProcinsts()A map of namespace URI substitutions to use when constructing a document. XmlOptions.setLoadSubstituteNamespaces(java.util.Map<java.lang.String, java.lang.String>)Additional namespace mappings to be added when constructing a document. XmlOptions.setLoadAdditionalNamespaces(java.util.Map<java.lang.String, java.lang.String>)To trim the underlying XML text buffer immediately after constructing a document, resulting in a smaller memory footprint. XmlOptions.setLoadTrimTextBuffer()Whether value facets should be checked as they are set. XmlOptions.setValidateOnSet()- Specified by:
execQueryin interfaceXmlObject- Parameters:
queryExpr- The XQuery expression.options- Options as described.- Returns:
- an array of all selected XmlObjects
- See Also:
XmlObject.execQuery(String)
-
changeType
Description copied from interface:XmlObjectChanges the schema type associated with this data and returns a new XmlObject instance whose schemaType is the new type.Returns the new XmlObject if the type change was successful, the old XmlObject if no changes could be made.
Certain type changes may be prohibited in the interior of an xml tree due to schema type system constraints (that is, due to a parent container within which the newly specified type is not permissible), but there are no constraints at the roottype changes are never prohibited at the root of an xml tree.If the type change is allowed, then the new XmlObject should be used rather than the old one. The old XmlObject instance and any other XmlObject instances in the subtree are permanently invalidated and should not be used. (They will return XmlValueDisconnectedException if you try to use them.)
If a type change is done on the interior of an Xml tree, then xsi:type attributes are updated as needed.
- Specified by:
changeTypein interfaceXmlObject- Returns:
- a new XmlObject instance whose schemaType is the new type
-
substitute
Description copied from interface:XmlObjectChanges the schema type associated with this data using substitution groups and returns an XmlObject instance whose schemaType is the new type and container name is the new name.Returns the new XmlObject if the substitution was successful, the old XmlObject if no changes could be made.
In order for the operation to succeed, several conditions must hold:- the container of this type must be an element
- a global element with the name
newNamemust exist and must be in the substitution group of the containing element - the
newTypetype must be consistent with the declared type of the new element
If the type change is allowed, then the new XmlObject should be used rather than the old one. The old XmlObject instance and any other XmlObject instances in the subtree are permanently invalidated and should not be used. (They will return XmlValueDisconnectedException if you try to use them.) If necessary, xsi:type attributes are updated.
- Specified by:
substitutein interfaceXmlObject- Parameters:
name- the new nametype- the new type- Returns:
- an XmlObject instance whose schemaType is the new type and container name is the new name
-
init_flags
-
initComplexType
protected void initComplexType(boolean complexType, boolean complexContent)Called by restriction subclasses within their constructors to enable complex type support. -
_isComplexType
protected boolean _isComplexType() -
_isComplexContent
protected boolean _isComplexContent() -
setValidateOnSet
public void setValidateOnSet() -
_validateOnSet
protected boolean _validateOnSet() -
isNil
public final boolean isNil()True if the value is nilled. -
isFixed
public final boolean isFixed()True if the value is fixed. -
isNillable
public final boolean isNillable()True if the value is allowed to be nil. -
isDefaultable
public final boolean isDefaultable()True if the value is currently defaulted. -
isDefault
public final boolean isDefault()True if the value is currently defaulted. -
setNil
public final void setNil()Nils the value. -
elementFlags
protected int elementFlags()Used for situations where these flags must be passed on to chained values. (See XmlAnySimpleType (allSimpleValue), union implementations). -
setImmutable
public void setImmutable()Used to make a free-standing xml simple value instance immutable. This is a one-way street, and it is illegal to attempt to make a value that is embedded in an xml document immutable.Once a value is marked as immutable, it is illegal to call setters of any kind.
-
isImmutable
public boolean isImmutable()Is this instance an immutable value?- Specified by:
isImmutablein interfaceXmlObject- Returns:
- true if the value is an immutable value.
-
attach_store
Called to initialize the TypeStore associated with this XmlObject implementation. If not called, this is a free-floating value holder.When a value is first attached, it is put in a completely invalidated state.
- Specified by:
attach_storein interfaceTypeStoreUser
-
invalidate_value
public final void invalidate_value()Called by a TypeStore to indicate that the text has been invalidated and should be fetched next time the value is needed.- Specified by:
invalidate_valuein interfaceTypeStoreUser
-
uses_invalidate_value
public final boolean uses_invalidate_value()Description copied from interface:TypeStoreUserA store can call uses_invalidate_value to know if calls to invalidate_value will be fruitful. If uses_invalidate_value returns false, invalidate_value need never be called.- Specified by:
uses_invalidate_valuein interfaceTypeStoreUser
-
invalidate_nilvalue
public final void invalidate_nilvalue()Called by a TypeStore to indicate that the xsi:nil attribute on the containing element (and possibly the text) has been invalidated and both should be consulted next time the value is needed.- Specified by:
invalidate_nilvaluein interfaceTypeStoreUser
-
invalidate_element_order
public final void invalidate_element_order()Called by a TypeStore to indicate that the element's default value, nillability, fixedness, etc, may have changed by virtue of the element order changing (and xsi:nil and the text may have changed too); so the store should be consulted next time any setter or getter is called.- Specified by:
invalidate_element_orderin interfaceTypeStoreUser
-
get_store
Used by the ComplexTypeImpl subclass to get direct access to the store.- Specified by:
get_storein interfaceTypeStoreUser
-
getXmlLocale
-
has_store
protected final boolean has_store() -
build_text
Called by a TypeStore to pull out the most reasonable text value from us. This is done after we have invalidated the store (typically when our value has been set).- Specified by:
build_textin interfaceTypeStoreUser
-
build_nil
public boolean build_nil()A store will call back on build_nil after we've called invalidate_nil and it needs to know what the nil value is.- Specified by:
build_nilin interfaceTypeStoreUser
-
validate_now
public void validate_now()A store will call back on validate_now to force us to look at the text if we're in an invalid state. We're allowed to throw an exception if the text isn't valid for our type.- Specified by:
validate_nowin interfaceTypeStoreUser
-
disconnect_store
public void disconnect_store()A store calls back here in order to force a disconnect. After this is done, the object should be considered invalid. Any attempt to access or set a value should result in an exception.Note that this is how we handle deletions and xsi:type changes.
- Specified by:
disconnect_storein interfaceTypeStoreUser
-
create_element_user
A typestore user can create a new TypeStoreUser instance for a given element child name as long as you also pass the qname contained by the xsi:type attribute, if any.Note that we will ignore the xsiType if it turns out to be invalid.
Returns null if there is no strongly typed information for that given element (which implies, recusively, no strongly typed information downwards).
- Specified by:
create_element_userin interfaceTypeStoreUser
-
create_attribute_user
A typestore user can create a new TypeStoreUser instance for a given attribute child, based on the attribute name.Returns null if there is no strongly typed information for that given attributes.
- Specified by:
create_attribute_userin interfaceTypeStoreUser
-
get_schema_type
Description copied from interface:TypeStoreUserReturns the schema type of this user- Specified by:
get_schema_typein interfaceTypeStoreUser
-
get_element_type
Description copied from interface:TypeStoreUserReturn the SchemaType which a child element of this name and xsi:type would be.- Specified by:
get_element_typein interfaceTypeStoreUser
-
get_attribute_type
Description copied from interface:TypeStoreUserReturn the SchemaType which an attribute of this name would be.- Specified by:
get_attribute_typein interfaceTypeStoreUser
-
get_default_element_text
Returns the default element text, if it's consistent. If it's not consistent, returns null, and requires a visitor walk.Also returns null if there is no default at all (although that can also be discovered via get_elementflags without doing a walk).
- Specified by:
get_default_element_textin interfaceTypeStoreUser
-
get_default_attribute_text
Returns the default attribute text for the attribute with the given name, or null if no default.- Specified by:
get_default_attribute_textin interfaceTypeStoreUser
-
get_elementflags
Returns the elementflags, if they're consistent. If they're not, returns -1, and requires a vistor walk.- Specified by:
get_elementflagsin interfaceTypeStoreUser
-
get_attributeflags
Returns the flags for the given attribute.- Specified by:
get_attributeflagsin interfaceTypeStoreUser
-
is_child_element_order_sensitive
public boolean is_child_element_order_sensitive()Returns false if child elements are insensitive to order; if it returns true, you're required to call invalidate_element_order on children to the right of any child order rearrangement.- Specified by:
is_child_element_order_sensitivein interfaceTypeStoreUser
-
get_element_ending_delimiters
Inserting a new element is always unambiguous except in one situation: when adding an element after the last one with that name (or the first one if there are none).In that case, add the element at the first possible slot BEFORE any element whose qname is contained in the QNameSet given. (If the QNameSet is empty, that means add the new element at the very end.)
If the returned QNameSet is null, treat it as if the QNameSet contained all QNames, i.e., add the new element at the very first position possible (adjacent to the last element of the same name, or at the very first slot if it is the first elt with that name).
- Specified by:
get_element_ending_delimitersin interfaceTypeStoreUser
-
new_visitor
A typestore user can return a visitor that is used to compute default text and elementflags for an arbitrary element.- Specified by:
new_visitorin interfaceTypeStoreUser
-
get_attribute_field
Description copied from interface:TypeStoreUserReturns the schema field for an attribute- Specified by:
get_attribute_fieldin interfaceTypeStoreUser
-
set_String
Setting a string preserves any noncanonical literal representation. This is done by storing the actual string in the underlying store after checking it against the primitive type for validity. -
update_from_complex_content
protected void update_from_complex_content()Update the value based on complex content. -
is_defaultable_ws
Types should return false if they don't treat the given whitespace as a default value. -
get_wscanon_rule
protected int get_wscanon_rule()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.
-
is_orphaned
protected final boolean is_orphaned()Describes the orphaned status of this object. -
check_orphaned
protected final void check_orphaned()Called before every getter and setter on the strongly typed classes to ensure that the object has not been orphaned. -
check_dated
public final void check_dated()Called prior to every get operation, to ensure that the value being read is valid. If the value has been invalidated, it is re-read from the underlying text store, and this may cause an out of range exception.This method deals with nils, nillability, defaults, etc.
-
get_wscanon_text
Grabs the undelying litral representation, applying the implementation's wscanon rule. Null if not simple content. -
set_text
This should set the value of the type from text, or throw an XmlValueOutOfRangeException if it can't. -
set_nil
protected abstract void set_nil()This should clear the value, and set it to whatever is supposed to be returned when the value is nilled. -
compute_text
This should return the canonical string value of the primitive. Only called when non-nil. -
getFloatValue
public float getFloatValue()Description copied from interface:SimpleValueReturns the value as a float.- Specified by:
getFloatValuein interfaceSimpleValue
-
getDoubleValue
public double getDoubleValue()Description copied from interface:SimpleValueReturns the value as a double.- Specified by:
getDoubleValuein interfaceSimpleValue
-
getBigDecimalValue
Description copied from interface:SimpleValueReturns the value as aBigDecimal.- Specified by:
getBigDecimalValuein interfaceSimpleValue
-
getBigIntegerValue
Description copied from interface:SimpleValueReturns the value as aBigInteger.- Specified by:
getBigIntegerValuein interfaceSimpleValue
-
getByteValue
public byte getByteValue()Description copied from interface:SimpleValueReturns the value as a byte.- Specified by:
getByteValuein interfaceSimpleValue
-
getShortValue
public short getShortValue()Description copied from interface:SimpleValueReturns the value as a short.- Specified by:
getShortValuein interfaceSimpleValue
-
getIntValue
public int getIntValue()Description copied from interface:SimpleValueReturns the value as an int.- Specified by:
getIntValuein interfaceSimpleValue
-
getLongValue
public long getLongValue()Description copied from interface:SimpleValueReturns the value as a long.- Specified by:
getLongValuein interfaceSimpleValue
-
toString
Description copied from interface:XmlObjectThe string is pretty-printed. If you want a non-pretty-printed string, or if you want to control options precisely, use the xmlText() methods.Note that when producing XML any object other than very root of the document, then you are guaranteed to be looking at only a fragment of XML, i.e., just the contents of an element or attribute, and and we will produce a string that starts with an
<xml-fragment>tag. The XmlOptions.setSaveOuter() option on xmlText can be used to produce the actual element name above the object if you wish. -
xmlText
Description copied from interface:XmlTokenSourceReturns standard XML text.The text returned represents the document contents starting at the current begin-tag or begin-document and ending at the matching end-tag or end-document. This is same content as newReader, but it is returned as a single string.
Throws an IllegalStateException if the XmlTokenSource is not positioned at begin-tag or begin-document (e.g., if it is at an attribute).
Note that this method does not produce XML with the XML declaration, including the encoding information. To save the XML declaration with the XML, see
XmlTokenSource.save(OutputStream)orXmlTokenSource.save(OutputStream, XmlOptions).- Specified by:
xmlTextin interfaceXmlTokenSource
-
xmlText
Description copied from interface:XmlTokenSourceJust like xmlText() but with options. Options map may be null.Note that this method does not produce XML with the XML declaration, including the encoding information. To save the XML declaration with the XML, see
XmlTokenSource.save(OutputStream)orXmlTokenSource.save(OutputStream, XmlOptions).- Specified by:
xmlTextin interfaceXmlTokenSource- See Also:
XmlOptions
-
getEnumValue
Description copied from interface:SimpleValueReturns the value as aStringEnumAbstractBase.- Specified by:
getEnumValuein interfaceSimpleValue
-
getStringValue
Description copied from interface:SimpleValueReturns the value as aString.- Specified by:
getStringValuein interfaceSimpleValue
-
getByteArrayValue
public byte[] getByteArrayValue()Description copied from interface:SimpleValueReturns the value as a byte array.- Specified by:
getByteArrayValuein interfaceSimpleValue
-
getBooleanValue
public boolean getBooleanValue()Description copied from interface:SimpleValueReturns the value as a boolean.- Specified by:
getBooleanValuein interfaceSimpleValue
-
getGDateValue
Description copied from interface:SimpleValueReturns the value as aGDate.- Specified by:
getGDateValuein interfaceSimpleValue
-
getDateValue
Description copied from interface:SimpleValueReturns the value as aDate.- Specified by:
getDateValuein interfaceSimpleValue
-
getCalendarValue
Description copied from interface:SimpleValueReturns the value as aCalendar.- Specified by:
getCalendarValuein interfaceSimpleValue
-
getGDurationValue
Description copied from interface:SimpleValueReturns the value as aGDuration.- Specified by:
getGDurationValuein interfaceSimpleValue
-
getQNameValue
Description copied from interface:SimpleValueReturns the value as aQName.- Specified by:
getQNameValuein interfaceSimpleValue
-
getListValue
Description copied from interface:SimpleValueReturns the value as aListof friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).- Specified by:
getListValuein interfaceSimpleValue
-
xgetListValue
Description copied from interface:SimpleValueReturns the value as aListof XmlAnySimpleType objects.- Specified by:
xgetListValuein interfaceSimpleValue
-
getObjectValue
Description copied from interface:SimpleValueReturns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).- Specified by:
getObjectValuein interfaceSimpleValue
-
setBooleanValue
public final void setBooleanValue(boolean v)Description copied from interface:SimpleValueSets the value as a boolean.- Specified by:
setBooleanValuein interfaceSimpleValue
-
setByteValue
public final void setByteValue(byte v)Description copied from interface:SimpleValueSets the value as a byte.- Specified by:
setByteValuein interfaceSimpleValue
-
setShortValue
public final void setShortValue(short v)Description copied from interface:SimpleValueSets the value as a short.- Specified by:
setShortValuein interfaceSimpleValue
-
setIntValue
public final void setIntValue(int v)Description copied from interface:SimpleValueSets the value as an int.- Specified by:
setIntValuein interfaceSimpleValue
-
setLongValue
public final void setLongValue(long v)Description copied from interface:SimpleValueSets the value as a long.- Specified by:
setLongValuein interfaceSimpleValue
-
setFloatValue
public final void setFloatValue(float v)Description copied from interface:SimpleValueSets the value as a float.- Specified by:
setFloatValuein interfaceSimpleValue
-
setDoubleValue
public final void setDoubleValue(double v)Description copied from interface:SimpleValueSets the value as a double.- Specified by:
setDoubleValuein interfaceSimpleValue
-
setByteArrayValue
public final void setByteArrayValue(byte[] obj)Description copied from interface:SimpleValueSets the value as a byte array.- Specified by:
setByteArrayValuein interfaceSimpleValue
-
setEnumValue
Description copied from interface:SimpleValueSets the value as aStringEnumAbstractBase.- Specified by:
setEnumValuein interfaceSimpleValue
-
setBigIntegerValue
Description copied from interface:SimpleValueSets the value as aBigInteger.- Specified by:
setBigIntegerValuein interfaceSimpleValue
-
setBigDecimalValue
Description copied from interface:SimpleValueSets the value as aBigDecimal.- Specified by:
setBigDecimalValuein interfaceSimpleValue
-
setCalendarValue
Description copied from interface:SimpleValueSets the value as aCalendar.- Specified by:
setCalendarValuein interfaceSimpleValue
-
setDateValue
Description copied from interface:SimpleValueSets the value as aDate.- Specified by:
setDateValuein interfaceSimpleValue
-
setGDateValue
Description copied from interface:SimpleValueSets the value as aGDate.- Specified by:
setGDateValuein interfaceSimpleValue
-
setGDateValue
-
setGDurationValue
Description copied from interface:SimpleValueSets the value as aGDuration.- Specified by:
setGDurationValuein interfaceSimpleValue
-
setGDurationValue
-
setQNameValue
Description copied from interface:SimpleValueSets the value as aQName.- Specified by:
setQNameValuein interfaceSimpleValue
-
setListValue
Description copied from interface:SimpleValueSets the value as aList.- Specified by:
setListValuein interfaceSimpleValue
-
setStringValue
Description copied from interface:SimpleValueSets the value as aString.- Specified by:
setStringValuein interfaceSimpleValue
-
setObjectValue
Description copied from interface:SimpleValueSets the value as an arbitraryObject.- Specified by:
setObjectValuein interfaceSimpleValue
-
set_newValue
-
set
Description copied from interface:XmlObjectSet the value/type of this XmlObject to be a copy of the source XmlObject. Because the type of the source may be different than this target, this XmlObject may become defunct. In this case the new XmlObject is returned. If no type change happens, the same this will be returned. -
generatedSetterHelperImpl
-
_set
Same as set() but unsynchronized. Warning: Using this method in mutithreaded environment can cause invalid states. -
set_list
-
set_boolean
protected void set_boolean(boolean v) -
set_byte
protected void set_byte(byte v) -
set_short
protected void set_short(short v) -
set_int
protected void set_int(int v) -
set_long
protected void set_long(long v) -
set_char
protected void set_char(char v) -
set_float
protected void set_float(float v) -
set_double
protected void set_double(double v) -
set_enum
-
set_ByteArray
protected void set_ByteArray(byte[] b) -
set_b64
protected void set_b64(byte[] b) -
set_hex
protected void set_hex(byte[] b) -
set_BigInteger
-
set_BigDecimal
-
set_Date
-
set_Calendar
-
set_GDate
-
set_GDuration
-
set_ComplexXml
-
set_QName
-
set_notation
-
set_xmlanysimple
-
valueEquals
Description copied from interface:XmlObjectTrue if the xml values are equal. Two different objects (which are distinguished by equals(obj) == false) may of course have equal values (valueEquals(obj) == true).Usually this method can be treated as an ordinary equivalence relation, but actually it is not is not transitive. Here is a precise specification:
There are two categories of XML object: objects with a known instance type, and objects whose only known type is one of the ur-types (either AnyType or AnySimpleType). The first category is compared in terms of logical value spaces, and the second category is compared lexically.
Within each of these two categories, valueEquals is a well-behaved equivalence relation. However, when comparing an object of known type with an object with ur-type, the comparison is done by attempting to convert the lexical form of the ur-typed object into the other type, and then comparing the results. Ur-typed objects are therefore treated as lexical wildcards and may be equal to objects in different value spaces, even though the objects in different value spaces are not equal to each other.
For example, the anySimpleType value "1" will compare as an equalValue to the string "1", the float value "1.0", the double value "1.0", the decimal "1", and the GYear "1", even though all these objects will compare unequal to each other since they lie in different value spaces. Note: as of XMLBeans 2.2.1 only implemented for simple type values.
- Specified by:
valueEqualsin interfaceXmlObject
-
compareTo
Implements Comparable. This compareTo is inconsistent with equals unless isImmutable() is true. -
compareValue
Description copied from interface:XmlObjectThis comparison method is similar to compareTo, but rather than throwing a ClassCastException when two values are incomparable, it returns the number 2. The result codes are -1 if this object is less than obj, 1 if this object is greater than obj, zero if the objects are equal, and 2 if the objects are incomparable.- Specified by:
compareValuein interfaceXmlObject
-
compare_to
This implementation of compare_to is allowed to do two unusual things: (1) it can assume that the xmlobj passed has a primitive type underlying the instance type that matches the current instance, and that neither is nil. (2) it is allowed to return 2 for "incomparable"; it should not throw an exception. -
equal_to
-
value_hash_code
protected abstract int value_hash_code() -
valueHashCode
public int valueHashCode()- Specified by:
valueHashCodein interfaceXmlObject
-
isInstanceOf
-
equals
-
hashCode
public final int hashCode() -
selectChildren
Selects the contents of the children elements with the given name.- Specified by:
selectChildrenin interfaceXmlObject- Parameters:
elementName- The name of the elements to be selected.- Returns:
- Returns the contents of the selected elements.
-
selectChildren
Selects the contents of the children elements with the given name.- Specified by:
selectChildrenin interfaceXmlObject- Parameters:
elementUri- The URI of the elements to be selected.elementLocalName- The local name of the elements to be selected.- Returns:
- Returns the contents of the selected elements.
-
selectChildren
Selects the contents of the children elements that are contained in the elementNameSet.- Specified by:
selectChildrenin interfaceXmlObject- Parameters:
elementNameSet- Set of element names to be selected.- Returns:
- Returns the contents of the selected elements.
- See Also:
SchemaType.qnameSetForWildcardElements(),for creating sets of qnames
-
selectAttribute
Selects the content of the attribute with the given name.- Specified by:
selectAttributein interfaceXmlObject- Parameters:
attributeName- The name of the attribute to be selected.- Returns:
- Returns the contents of the selected attribute.
-
selectAttribute
Selects the content of the attribute with the given name.- Specified by:
selectAttributein interfaceXmlObject- Parameters:
attributeUri- The URI of the attribute to be selected.attributeLocalName- The local name of the attribute to be selected.- Returns:
- Returns the content of the selected attribute.
-
selectAttributes
Selects the contents of the attributes that are contained in the elementNameSet.- Specified by:
selectAttributesin interfaceXmlObject- Parameters:
attributeNameSet- Set of attribute names to be selected.- Returns:
- Returns the contents of the selected attributes.
- See Also:
SchemaType.qnameSetForWildcardAttributes(),for creating sets of qnames
-
writeReplace
This method can writeReplace either an unwrapped XmlObjectBase or an XBean proxy. A "true" argument means unwrapped.The serialization strategy for XmlObjects is this:
(1) Only the root XmlObject for a document actually gets fully serialized; it is serialized as a SerializedRootObject, which simply saves itself as XML text.
(2) Interior XmlObjects get serialized as a reference to the root XmlObject for their document, plus an integer which indicates the position of the XmlObject within the owner document. This pair is stored as a SerializedInteriorObject.
Both objects can be maked as wrapped or unwrapped. If wrapped, then the proxy is returned when deserializing; if unwrapped, then the proxy is stripped when deserializing.
-
java_value
-
get_default_attribute_value
Called by code generated code to get the default attribute value for a given attribute name, or null if none. -
getObjectArray
protected <T> T[] getObjectArray(QName elementName, Function<SimpleValue,T> fun, IntFunction<T[]> arrayCon) -
getEnumArray
-
getBooleanArray
-
getFloatArray
-
getDoubleArray
-
getByteArray
-
getShortArray
-
getIntArray
-
getLongArray
-
getXmlObjectArray
-
getObjectArray
protected <T> T[] getObjectArray(QNameSet elementSet, Function<SimpleValue,T> fun, IntFunction<T[]> arrayCon) -
getEnumArray
-
getBooleanArray
-
getFloatArray
-
getDoubleArray
-
getByteArray
-
getShortArray
-
getIntArray
-
getLongArray
-
getXmlObjectArray
-
xgetArray
-
xgetArray
-