FilterXmlObject Class

com.bea.xml
FilterXmlObject Class

public abstract class FilterXmlObject

    extends Object
    implements SimpleValue, XmlObject

A FilterXmlObject delegates to some other XmlObject, which it can use as its basic source of data, possibly transforming the data along the way or providing additional functionality. The class FilterXmlObject itself simply overrides all methods of XmlObject with versions that pass all requests to the underlying XmlObject. Subclasses of FilterXmlObject may further override some of these methods and may also provide additional methods and fields.

Note: it is important that FilterXmlOBject has no storage (i.e., no non-transient fields), because subclasses may be serializable and adding storage would break the serialization format.


Hierarchy
Object
  FilterXmlObject
All Implemented Interfaces

SimpleValue, XmlObject, XmlTokenSource

Constructor Summary

FilterXmlObject()

 

Method Summary

public BigDecimal
bigDecimalValue()
Returns the value as a BigDecimal
public BigInteger
bigIntegerValue()
Returns the value as a BigInteger
public boolean
booleanValue()
Returns the value as a boolean
public byte[]
byteArrayValue()
Returns the value as a byte array
public byte
byteValue()
Returns the value as a byte
public Calendar
calendarValue()
Returns the value as a Calendar
public XmlObject
changeType(SchemaType newType)
Changes the schema type associated with this data and returns a new XmlObject instance whose schemaType is the new type.
public int
compareTo(Object obj)
Impelements the Comparable interface by comparing two simple xml values based on their standard XML schema ordering.
public int
compareValue(XmlObject obj)
This comparison method is similar to compareTo, but rather than throwing a ClassCastException when two values are incomparable, it returns the number 2.
public XmlObject
copy()
Returns a deep copy of this XmlObject.
public Date
dateValue()
Returns the value as a Date
public XmlDocumentProperties
documentProperties()
Returns the XmlDocumentProperties object for the document this token source is associated with.
public double
doubleValue()
Returns the value as a double
public StringEnumAbstractBase
enumValue()
Returns the value as a StringEnumAbstractBase
public XmlObject[]
execQuery(String query)
Executes a query.
public XmlObject[]
execQuery(String query, XmlOptions options)
Executes a query with options.
public float
floatValue()
Returns the value as a float
public GDate
gDateValue()
Returns the value as a GDate
public GDuration
gDurationValue()
Returns the value as a GDuration
public BigDecimal
getBigDecimalValue()
Returns the value as a BigDecimal.
public BigInteger
getBigIntegerValue()
Returns the value as a BigInteger.
public boolean
getBooleanValue()
Returns the value as a boolean.
public byte[]
getByteArrayValue()
Returns the value as a byte array.
public byte
getByteValue()
Returns the value as a byte.
public Calendar
getCalendarValue()
Returns the value as a Calendar.
public Date
getDateValue()
Returns the value as a Date.
public double
getDoubleValue()
Returns the value as a double.
public StringEnumAbstractBase
getEnumValue()
Returns the value as a StringEnumAbstractBase.
public float
getFloatValue()
Returns the value as a float.
public GDate
getGDateValue()
Returns the value as a GDate.
public GDuration
getGDurationValue()
Returns the value as a GDuration.
public int
getIntValue()
Returns the value as an int.
public List
getListValue()
Returns the value as a List of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).
public long
getLongValue()
Returns the value as a long.
public Object
getObjectValue()
Returns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).
public QName
getQNameValue()
Returns the value as a QName.
public short
getShortValue()
Returns the value as a short.
public String
getStringValue()
Returns the value as a String.
public SchemaType
instanceType()
The same as getSchemaType unless this is a union instance or nil value.
public int
intValue()
Returns the value as an int
public boolean
isImmutable()
True if the value is an immutable value.
public boolean
isNil()
True if the value is nil.
public List
listValue()
Returns the value as a List of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration)
public long
longValue()
Returns the value as a long
public Object
monitor()
Returns the synchronization object for the document.
public XmlCursor
newCursor()
Returns a new XML cursor.
public Node
newDomNode()
Returns a W3C DOM Node containing the XML represented by this source.
public Node
newDomNode(XmlOptions options)
Just like newDomNode() but with options.
public InputStream
newInputStream()
Returns a new stream containing standard XML text, encoded according to the given encoding.
public InputStream
newInputStream(XmlOptions options)
Just like newInputStream(String encoding) but with options.
public Reader
newReader()
Returns a new character reader containing XML text.
public Reader
newReader(XmlOptions options)
Just like newReader() but with options.
public XMLInputStream
newXMLInputStream()
Returns a new XmlInputStream.
public XMLInputStream
newXMLInputStream(XmlOptions options)

Just like newXMLInputStream() but with any of a number of options.

public void
objectSet(Object obj)
Sets the value as an arbitrary Object.
public Object
objectValue()
Returns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration)
public QName
qNameValue()
Returns the value as a QName
public void
save(ContentHandler ch, LexicalHandler lh)
Writes the XML represented by this source to the given SAX content and lexical handlers.
public void
save(File file)
Writes the XML represented by this source to the given File.
public void
save(OutputStream os)
Writes the XML represented by this source to the given output stream.
public void
save(Writer w)
Writes the XML represented by this source to the given writer.
public void
save(ContentHandler ch, LexicalHandler lh, XmlOptions options)
Writes the XML represented by this source to the given SAX content and lexical handlers.
public void
save(File file, XmlOptions options)
Writes the XML represented by this source to the given File.
public void
save(OutputStream os, XmlOptions options)
Writes the XML represented by this source to the given output stream.
public void
save(Writer w, XmlOptions options)
Writes the XML represented by this source to the given writer.
public SchemaType
schemaType()
The schema type for this instance.
public XmlObject[]
selectPath(String path)
Selects a path.
public XmlObject[]
selectPath(String path, XmlOptions options)
Selects a path, applying options.
public XmlObject
set(XmlObject srcObj)
Set the value/type of this XmlObject to be a copy of the source XmlObject.
public void
set(String obj)
Sets the value as a String
public void
set(boolean v)
Sets the value as a boolean
public void
set(byte v)
Sets the value as a byte.
public void
set(short v)
Sets the value as a short.
public void
set(int v)
Sets the value as an int.
public void
set(long v)
Sets the value as a long.
public void
set(BigInteger obj)
Sets the value as a BigInteger.
public void
set(BigDecimal obj)
Sets the value as a BigDecimal
public void
set(float v)
Sets the value as a float.
public void
set(double v)
Sets the value as a double.
public void
set(byte[] obj)
Sets the value as a byte array.
public void
set(StringEnumAbstractBase obj)
Sets the value as a StringEnumAbstractBase.
public void
set(Calendar obj)
Sets the value as a Calendar.
public void
set(Date obj)
Sets the value as a Date.
public void
set(GDateSpecification obj)
Sets the value as a GDate.
public void
set(GDurationSpecification obj)
Sets the value as a GDuration.
public void
set(QName obj)
Sets the value as a QName.
public void
set(List obj)
Sets the value as a List.
public void
setBigDecimalValue(BigDecimal obj)
Sets the value as a BigDecimal.
public void
setBigIntegerValue(BigInteger obj)
Sets the value as a BigInteger.
public void
setBooleanValue(boolean v)
Sets the value as a boolean.
public void
setByteArrayValue(byte[] obj)
Sets the value as a byte array.
public void
setByteValue(byte v)
Sets the value as a byte.
public void
setCalendarValue(Calendar obj)
Sets the value as a Calendar.
public void
setDateValue(Date obj)
Sets the value as a Date.
public void
setDoubleValue(double v)
Sets the value as a double.
public void
setEnumValue(StringEnumAbstractBase obj)
Sets the value as a StringEnumAbstractBase.
public void
setFloatValue(float v)
Sets the value as a float.
public void
setGDateValue(GDate obj)
Sets the value as a GDate.
public void
setGDurationValue(GDuration obj)
Sets the value as a GDuration.
public void
setIntValue(int v)
Sets the value as an int.
public void
setListValue(List obj)
Sets the value as a List.
public void
setLongValue(long v)
Sets the value as a long.
public void
setNil()
Sets the value to nil.
public void
setObjectValue(Object obj)
Sets the value as an arbitrary Object.
public void
setQNameValue(QName obj)
Sets the value as a QName.
public void
setShortValue(short v)
Sets the value as a short.
public void
setStringValue(String obj)
Sets the value as a String.
public short
shortValue()
Returns the value as a short
public String
stringValue()
Returns the value as a String
public abstract XmlObject
underlyingXmlObject()
This abstract method is called to obtain the underlying XmlObject.
public boolean
validate()
Returns true if the contents of this object are valid accoring to schemaType().
public boolean
validate(XmlOptions options)

Just like validate(), but with options.

public boolean
valueEquals(XmlObject obj)
True if the xml values are equal.
public int
valueHashCode()
public List
xgetListValue()
Returns the value as a List of XmlAnySimpleType objects.
public List
xlistValue()
Returns the value as a List of XmlAnySimpleType objects
public String
xmlText()
Returns standard XML text.
public String
xmlText(XmlOptions options)
Just like xmlText() but with options.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.xml.SimpleValue
bigDecimalValue, bigIntegerValue, booleanValue, byteArrayValue, byteValue, calendarValue, dateValue, doubleValue, enumValue, floatValue, gDateValue, gDurationValue, getBigDecimalValue, getBigIntegerValue, getBooleanValue, getByteArrayValue, getByteValue, getCalendarValue, getDateValue, getDoubleValue, getEnumValue, getFloatValue, getGDateValue, getGDurationValue, getIntValue, getListValue, getLongValue, getObjectValue, getQNameValue, getShortValue, getStringValue, instanceType, intValue, listValue, longValue, objectSet, objectValue, qNameValue, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setBigDecimalValue, setBigIntegerValue, setBooleanValue, setByteArrayValue, setByteValue, setCalendarValue, setDateValue, setDoubleValue, setEnumValue, setFloatValue, setGDateValue, setGDurationValue, setIntValue, setListValue, setLongValue, setObjectValue, setQNameValue, setShortValue, setStringValue, shortValue, stringValue, xgetListValue, xlistValue
 
Methods from interface com.bea.xml.XmlObject
changeType, compareTo, compareValue, copy, execQuery, execQuery, isImmutable, isNil, schemaType, selectPath, selectPath, set, setNil, toString, validate, validate, valueEquals, valueHashCode
 
Methods from interface com.bea.xml.XmlTokenSource
documentProperties, monitor, newCursor, newDomNode, newDomNode, newInputStream, newInputStream, newReader, newReader, newXMLInputStream, newXMLInputStream, save, save, save, save, save, save, save, save, xmlText, xmlText
 

Constructor Detail

FilterXmlObject

public FilterXmlObject()
 

Method Detail

bigDecimalValue() Method

public BigDecimal bigDecimalValue()
Description copied from SimpleValue.bigDecimalValue()
Returns the value as a BigDecimal. *


bigIntegerValue() Method

public BigInteger bigIntegerValue()
Description copied from SimpleValue.bigIntegerValue()
Returns the value as a BigInteger. *


booleanValue() Method

public boolean booleanValue()
Description copied from SimpleValue.booleanValue()
Returns the value as a boolean. *


byteArrayValue() Method

public byte[] byteArrayValue()
Description copied from SimpleValue.byteArrayValue()
Returns the value as a byte array. *


byteValue() Method

public byte byteValue()
Description copied from SimpleValue.byteValue()
Returns the value as a byte. *


calendarValue() Method

public Calendar calendarValue()
Description copied from SimpleValue.calendarValue()
Returns the value as a Calendar. *


changeType(SchemaType) Method

public XmlObject changeType(SchemaType newType)
Description copied from XmlObject.changeType(SchemaType)
Changes the schema type associated with this data and returns a new XmlObject instance whose schemaType is the new type.

Returns null if the type change is not allowed. Certain type changes may be prohibited on 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 InvalidStateException 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.


compareTo(Object) Method

public int compareTo(Object obj)
Description copied from XmlObject.compareTo(Object)
Impelements the Comparable interface by comparing two simple xml values based on their standard XML schema ordering. Throws a ClassCastException if no standard ordering applies, or if the two values are incomparable within a partial order.


compareValue(XmlObject) Method

public int compareValue(XmlObject obj)
Description copied from XmlObject.compareValue(XmlObject)
This 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.


copy() Method

public XmlObject copy()
Description copied from XmlObject.copy()
Returns 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.


dateValue() Method

public Date dateValue()
Description copied from SimpleValue.dateValue()
Returns the value as a Date. *


documentProperties() Method

public XmlDocumentProperties documentProperties()
Description copied from XmlTokenSource.documentProperties()
Returns the XmlDocumentProperties object for the document this token source is associated with.


doubleValue() Method

public double doubleValue()
Description copied from SimpleValue.doubleValue()
Returns the value as a double. *


enumValue() Method

public StringEnumAbstractBase enumValue()
Description copied from SimpleValue.enumValue()
Returns the value as a StringEnumAbstractBase. *


execQuery(String) Method

public XmlObject[] execQuery(String query)
Description copied from XmlObject.execQuery(String)
Executes 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.


execQuery(String, XmlOptions) Method

public XmlObject[] execQuery(String query, 
                           XmlOptions options)
Description copied from XmlObject.execQuery(String, XmlOptions)
Executes a query with options. Use the options parameter to specify the following:

To specify thisUse this method
The document type for the root element. XmlOptions.setDocumentType(SchemaType)
To replace the document element with the specified QName when constructing the resulting document. XmlOptions.setLoadReplaceDocumentElement(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(Map)
Additional namespace mappings to be added when constructing a document. XmlOptions.setLoadAdditionalNamespaces(Map)
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()

Parameters

query
The XQuery expression.
options
Options as described.

floatValue() Method

public float floatValue()
Description copied from SimpleValue.floatValue()
Returns the value as a float. *


gDateValue() Method

public GDate gDateValue()
Description copied from SimpleValue.gDateValue()
Returns the value as a GDate. *


gDurationValue() Method

public GDuration gDurationValue()
Description copied from SimpleValue.gDurationValue()
Returns the value as a GDuration. *


getBigDecimalValue() Method

public BigDecimal getBigDecimalValue()
Description copied from SimpleValue.getBigDecimalValue()
Returns the value as a BigDecimal.


getBigIntegerValue() Method

public BigInteger getBigIntegerValue()
Description copied from SimpleValue.getBigIntegerValue()
Returns the value as a BigInteger.


getBooleanValue() Method

public boolean getBooleanValue()
Description copied from SimpleValue.getBooleanValue()
Returns the value as a boolean.


getByteArrayValue() Method

public byte[] getByteArrayValue()
Description copied from SimpleValue.getByteArrayValue()
Returns the value as a byte array.


getByteValue() Method

public byte getByteValue()
Description copied from SimpleValue.getByteValue()
Returns the value as a byte.


getCalendarValue() Method

public Calendar getCalendarValue()
Description copied from SimpleValue.getCalendarValue()
Returns the value as a Calendar.


getDateValue() Method

public Date getDateValue()
Description copied from SimpleValue.getDateValue()
Returns the value as a Date.


getDoubleValue() Method

public double getDoubleValue()
Description copied from SimpleValue.getDoubleValue()
Returns the value as a double.


getEnumValue() Method

public StringEnumAbstractBase getEnumValue()
Description copied from SimpleValue.getEnumValue()
Returns the value as a StringEnumAbstractBase.


getFloatValue() Method

public float getFloatValue()
Description copied from SimpleValue.getFloatValue()
Returns the value as a float.


getGDateValue() Method

public GDate getGDateValue()
Description copied from SimpleValue.getGDateValue()
Returns the value as a GDate.


getGDurationValue() Method

public GDuration getGDurationValue()
Description copied from SimpleValue.getGDurationValue()
Returns the value as a GDuration.


getIntValue() Method

public int getIntValue()
Description copied from SimpleValue.getIntValue()
Returns the value as an int.


getListValue() Method

public List getListValue()
Description copied from SimpleValue.getListValue()
Returns the value as a List of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).


getLongValue() Method

public long getLongValue()
Description copied from SimpleValue.getLongValue()
Returns the value as a long.


getObjectValue() Method

public Object getObjectValue()
Description copied from SimpleValue.getObjectValue()
Returns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration).


getQNameValue() Method

public QName getQNameValue()
Description copied from SimpleValue.getQNameValue()
Returns the value as a QName.


getShortValue() Method

public short getShortValue()
Description copied from SimpleValue.getShortValue()
Returns the value as a short.


getStringValue() Method

public String getStringValue()
Description copied from SimpleValue.getStringValue()
Returns the value as a String.


instanceType() Method

public SchemaType instanceType()
Description copied from SimpleValue.instanceType()
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.


intValue() Method

public int intValue()
Description copied from SimpleValue.intValue()
Returns the value as an int. *


isImmutable() Method

public boolean isImmutable()
Description copied from XmlObject.isImmutable()
True if the value is an immutable value. Immutable values do not have a position in a tree; rather, they are stand-alone simple type values. If the object is immutable, the equals() methods tests for value equality, and the object can be used as the key for a hash.


isNil() Method

public boolean isNil()
Description copied from XmlObject.isNil()
True if the value is nil. Note that in order to be nil, the value must be in an element, and the element containing the value must be marked as nillable in the schema.


listValue() Method

public List listValue()
Description copied from SimpleValue.listValue()
Returns the value as a List of friendly Java objects (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration). *


longValue() Method

public long longValue()
Description copied from SimpleValue.longValue()
Returns the value as a long. *


monitor() Method

public Object monitor()
Description copied from XmlTokenSource.monitor()
Returns 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.


newCursor() Method

public XmlCursor newCursor()
Description copied from XmlTokenSource.newCursor()
Returns 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.


newDomNode() Method

public Node newDomNode()
Description copied from XmlTokenSource.newDomNode()
Returns 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.


newDomNode(XmlOptions) Method

public Node newDomNode(XmlOptions options)
Description copied from XmlTokenSource.newDomNode(XmlOptions)
Just like newDomNode() but with options. Options map may be null.


newInputStream() Method

public InputStream newInputStream()
Description copied from XmlTokenSource.newInputStream()
Returns 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).


newInputStream(XmlOptions) Method

public InputStream newInputStream(XmlOptions options)
Description copied from XmlTokenSource.newInputStream(XmlOptions)
Just like newInputStream(String encoding) but with options. Options map may be null.


newReader() Method

public Reader newReader()
Description copied from XmlTokenSource.newReader()
Returns 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).


newReader(XmlOptions) Method

public Reader newReader(XmlOptions options)
Description copied from XmlTokenSource.newReader(XmlOptions)
Just like newReader() but with options. Options map may be null.


newXMLInputStream() Method

DEPRECATED Superceded by JSR 173

public XMLInputStream newXMLInputStream()
Description copied from com.bea.xml.XmlTokenSource.newXMLInputStream()
Returns a new XmlInputStream. 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).


newXMLInputStream(XmlOptions) Method

DEPRECATED Superceded by JSR 173

public XMLInputStream newXMLInputStream(XmlOptions options)
Description copied from com.bea.xml.XmlTokenSource.newXMLInputStream(com.bea.xml.XmlOptions)

Just like newXMLInputStream() but with any of a number of options. Use the options parameter to specify the following:

To specify thisUse this method
The character encoding to use when converting the character data in the XML to bytess. XmlOptions.setCharacterEncoding(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(Map)
Suggested namespace prefixes to use when saving. Used only when a namespace attribute needs to be synthesized. XmlOptions.setSaveSuggestedPrefixes(Map)
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.setSaveAggresiveNamespaces()
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(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(QName)

Parameters

options
Any of the described options.

Returns

A new validating XMLInputStream.

objectSet(Object) Method

public void objectSet(Object obj)
Description copied from SimpleValue.objectSet(Object)
Sets the value as an arbitrary Object.


objectValue() Method

public Object objectValue()
Description copied from SimpleValue.objectValue()
Returns a union value as a its natural friendly Java object (String, Integer, Byte, Short, Long, BigInteger, Decimal, Float, Double, byte[], Calendar, GDuration). *


qNameValue() Method

public QName qNameValue()
Description copied from SimpleValue.qNameValue()
Returns the value as a QName. *


save(ContentHandler, LexicalHandler) Method

public void save(ContentHandler ch, 
                 LexicalHandler lh)
throws SAXException
Description copied from XmlTokenSource.save(ContentHandler, LexicalHandler)
Writes the XML represented by this source to the given SAX content and lexical handlers.

Exceptions

SAXException

save(File) Method

public void save(File file)
throws IOException
Description copied from XmlTokenSource.save(File)
Writes the XML represented by this source to the given File.

Exceptions

IOException

save(OutputStream) Method

public void save(OutputStream os)
throws IOException
Description copied from XmlTokenSource.save(OutputStream)
Writes the XML represented by this source to the given output stream.

Exceptions

IOException

save(Writer) Method

public void save(Writer w)
throws IOException
Description copied from XmlTokenSource.save(Writer)
Writes the XML represented by this source to the given writer.

Exceptions

IOException

save(ContentHandler, LexicalHandler, XmlOptions) Method

public void save(ContentHandler ch, 
                 LexicalHandler lh, 
                 XmlOptions options)
throws SAXException
Description copied from XmlTokenSource.save(ContentHandler, LexicalHandler, XmlOptions)
Writes the XML represented by this source to the given SAX content and lexical handlers.

Exceptions

SAXException

save(File, XmlOptions) Method

public void save(File file, 
                 XmlOptions options)
throws IOException
Description copied from XmlTokenSource.save(File, XmlOptions)
Writes the XML represented by this source to the given File.

Exceptions

IOException

save(OutputStream, XmlOptions) Method

public void save(OutputStream os, 
                 XmlOptions options)
throws IOException
Description copied from XmlTokenSource.save(OutputStream, XmlOptions)
Writes the XML represented by this source to the given output stream.

Exceptions

IOException

save(Writer, XmlOptions) Method

public void save(Writer w, 
                 XmlOptions options)
throws IOException
Description copied from XmlTokenSource.save(Writer, XmlOptions)
Writes the XML represented by this source to the given writer.

Exceptions

IOException

schemaType() Method

public SchemaType schemaType()
Description copied from XmlObject.schemaType()
The schema type for this instance. This is a permanent, unchanging property of the instance.


selectPath(String) Method

public XmlObject[] selectPath(String path)
Description copied from XmlObject.selectPath(String)
Selects a path. Path can be a string or precompiled path String.

The path must be a relative path, where "." represents the element or attribute containg 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 com.bea.xml.*;
 [...]
   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.


selectPath(String, XmlOptions) Method

public XmlObject[] selectPath(String path, 
                            XmlOptions options)
Description copied from XmlObject.selectPath(String, XmlOptions)
Selects a path, applying options.


set(XmlObject) Method

public XmlObject set(XmlObject srcObj)
Description copied from XmlObject.set(XmlObject)
Set 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.


set(String) Method

public void set(String obj)
Description copied from SimpleValue.set(String)
Sets the value as a String. *


set(boolean) Method

public void set(boolean v)
Description copied from SimpleValue.set(boolean)
Sets the value as a boolean. *


set(byte) Method

public void set(byte v)
Description copied from SimpleValue.set(byte)
Sets the value as a byte.


set(short) Method

public void set(short v)
Description copied from SimpleValue.set(short)
Sets the value as a short.


set(int) Method

public void set(int v)
Description copied from SimpleValue.set(int)
Sets the value as an int.


set(long) Method

public void set(long v)
Description copied from SimpleValue.set(long)
Sets the value as a long.


set(BigInteger) Method

public void set(BigInteger obj)
Description copied from SimpleValue.set(BigInteger)
Sets the value as a BigInteger.


set(BigDecimal) Method

public void set(BigDecimal obj)
Description copied from SimpleValue.set(BigDecimal)
Sets the value as a BigDecimal


set(float) Method

public void set(float v)
Description copied from SimpleValue.set(float)
Sets the value as a float.


set(double) Method

public void set(double v)
Description copied from SimpleValue.set(double)
Sets the value as a double.


set(byte[]) Method

public void set(byte[] obj)
Description copied from SimpleValue.set(byte[])
Sets the value as a byte array.


set(StringEnumAbstractBase) Method

public void set(StringEnumAbstractBase obj)
Description copied from SimpleValue.set(StringEnumAbstractBase)
Sets the value as a StringEnumAbstractBase.


set(Calendar) Method

public void set(Calendar obj)
Description copied from SimpleValue.set(Calendar)
Sets the value as a Calendar.


set(Date) Method

public void set(Date obj)
Description copied from SimpleValue.set(Date)
Sets the value as a Date.


set(GDateSpecification) Method

public void set(GDateSpecification obj)
Description copied from SimpleValue.set(GDateSpecification)
Sets the value as a GDate.


set(GDurationSpecification) Method

public void set(GDurationSpecification obj)
Description copied from SimpleValue.set(GDurationSpecification)
Sets the value as a GDuration.


set(QName) Method

public void set(QName obj)
Description copied from SimpleValue.set(QName)
Sets the value as a QName.


set(List) Method

public void set(List obj)
Description copied from SimpleValue.set(List)
Sets the value as a List.


setBigDecimalValue(BigDecimal) Method

public void setBigDecimalValue(BigDecimal obj)
Description copied from SimpleValue.setBigDecimalValue(BigDecimal)
Sets the value as a BigDecimal.


setBigIntegerValue(BigInteger) Method

public void setBigIntegerValue(BigInteger obj)
Description copied from SimpleValue.setBigIntegerValue(BigInteger)
Sets the value as a BigInteger.


setBooleanValue(boolean) Method

public void setBooleanValue(boolean v)
Description copied from SimpleValue.setBooleanValue(boolean)
Sets the value as a boolean.


setByteArrayValue(byte[]) Method

public void setByteArrayValue(byte[] obj)
Description copied from SimpleValue.setByteArrayValue(byte[])
Sets the value as a byte array.


setByteValue(byte) Method

public void setByteValue(byte v)
Description copied from SimpleValue.setByteValue(byte)
Sets the value as a byte.


setCalendarValue(Calendar) Method

public void setCalendarValue(Calendar obj)
Description copied from SimpleValue.setCalendarValue(Calendar)
Sets the value as a Calendar.


setDateValue(Date) Method

public void setDateValue(Date obj)
Description copied from SimpleValue.setDateValue(Date)
Sets the value as a Date.


setDoubleValue(double) Method

public void setDoubleValue(double v)
Description copied from SimpleValue.setDoubleValue(double)
Sets the value as a double.


setEnumValue(StringEnumAbstractBase) Method

public void setEnumValue(StringEnumAbstractBase obj)
Description copied from SimpleValue.setEnumValue(StringEnumAbstractBase)
Sets the value as a StringEnumAbstractBase.


setFloatValue(float) Method

public void setFloatValue(float v)
Description copied from SimpleValue.setFloatValue(float)
Sets the value as a float.


setGDateValue(GDate) Method

public void setGDateValue(GDate obj)
Description copied from SimpleValue.setGDateValue(GDate)
Sets the value as a GDate.


setGDurationValue(GDuration) Method

public void setGDurationValue(GDuration obj)
Description copied from SimpleValue.setGDurationValue(GDuration)
Sets the value as a GDuration.


setIntValue(int) Method

public void setIntValue(int v)
Description copied from SimpleValue.setIntValue(int)
Sets the value as an int.


setListValue(List) Method

public void setListValue(List obj)
Description copied from SimpleValue.setListValue(List)
Sets the value as a List.


setLongValue(long) Method

public void setLongValue(long v)
Description copied from SimpleValue.setLongValue(long)
Sets the value as a long.


setNil() Method

public void setNil()
Description copied from XmlObject.setNil()
Sets the value to nil. The element containing the value must be marked as nillable in the schema.


setObjectValue(Object) Method

public void setObjectValue(Object obj)
Description copied from SimpleValue.setObjectValue(Object)
Sets the value as an arbitrary Object.


setQNameValue(QName) Method

public void setQNameValue(QName obj)
Description copied from SimpleValue.setQNameValue(QName)
Sets the value as a QName.


setShortValue(short) Method

public void setShortValue(short v)
Description copied from SimpleValue.setShortValue(short)
Sets the value as a short.


setStringValue(String) Method

public void setStringValue(String obj)
Description copied from SimpleValue.setStringValue(String)
Sets the value as a String.


shortValue() Method

public short shortValue()
Description copied from SimpleValue.shortValue()
Returns the value as a short. *


stringValue() Method

public String stringValue()
Description copied from SimpleValue.stringValue()
Returns the value as a String. *


underlyingXmlObject() Method

public abstract XmlObject underlyingXmlObject()
This abstract method is called to obtain the underlying XmlObject. Override this method to supply or compute the wrapped object.

Every other method of this class delegates to the object returned from this method. It is assumed that the object implements all the methods of both XmlObject and SimpleValue.


validate() Method

public boolean validate()
Description copied from XmlObject.validate()
Returns true if the contents of this object are valid accoring to schemaType().

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.


validate(XmlOptions) Method

public boolean validate(XmlOptions options)
Description copied from XmlObject.validate(XmlOptions)

Just like validate(), but with options.

If you wish to collect error messages and locations while validating, use the XmlOptions.setErrorListener(Collection) 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");
      }
 }
 

Parameters

options
An object that implements the Collection interface.

valueEquals(XmlObject) Method

public boolean valueEquals(XmlObject obj)
Description copied from XmlObject.valueEquals(XmlObject)
True 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 equvalence 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.


valueHashCode() Method

public int valueHashCode()

xgetListValue() Method

public List xgetListValue()
Description copied from SimpleValue.xgetListValue()
Returns the value as a List of XmlAnySimpleType objects.


xlistValue() Method

public List xlistValue()
Description copied from SimpleValue.xlistValue()
Returns the value as a List of XmlAnySimpleType objects. *


xmlText() Method

public String xmlText()
Description copied from XmlTokenSource.xmlText()
Returns 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).


xmlText(XmlOptions) Method

public String xmlText(XmlOptions options)
Description copied from XmlTokenSource.xmlText(XmlOptions)
Just like xmlText() but with options. Options map may be null.