Top Fields Methods
org.apache.derby.iapi.types

public Interface XMLDataValue

extends DataValueDescriptor
Known Direct Implementers
org.apache.derby.iapi.types.XML
Imports
org.apache.derby.shared.common.error.StandardException

Field Summary

Inherited from org.apache.derby.iapi.types.DataValueDescriptor:
UNKNOWN_LOGICAL_LENGTH

Method Summary

Modifier and TypeMethod and Description
public int
getXType()

Retrieve this XML value's qualified type.

public boolean
hasTopLevelAttr()

Return whether or not this XML value represents a sequence that has one or more top-level attribute nodes.

public void
markAsHavingTopLevelAttr()

Take note of the fact this XML value represents an XML sequence that has one or more top-level attribute nodes.

public void
setXType(int xtype)

Set this XML value's qualified type.

public BooleanDataValue

Returns:

True if evaluation of the query expression stored in sqlxUtil returns at least one node for this XML value; unknown if the xml value is NULL; false otherwise.
XMLExists
(SqlXmlUtil
Contains SQL/XML objects and util methods that facilitate execution of XML-related operations
sqlxUtil
)

The SQL/XML XMLExists operator.

public XMLDataValue

Returns:

If 'text' constitutes a valid XML document, it has been stored in this XML value and this XML value returned; otherwise, an exception is thrown.
XMLParse
(StringDataValue
The string value to check.
stringValue
,
boolean
Whether or not to preserve ignorable whitespace.
preserveWS
,
SqlXmlUtil
Contains SQL/XML objects and util methods that facilitate execution of XML-related operations
sqlxUtil
)

Method to parse an XML string and, if it's valid, store the _serialized_ version locally and then return this XMLDataValue.

public XMLDataValue

Returns:

An XMLDataValue whose content corresponds to the serialized version of the results from evaluation of the query expression.

Note

this XMLDataValue may not be storable into Derby XML columns.

XMLQuery
(SqlXmlUtil
Contains SQL/XML objects and util methods that facilitate execution of XML-related operations
sqlxUtil
,
XMLDataValue
The result of a previous call to this method; null if not called yet.
result
)

Evaluate the XML query expression contained within the received util object against this XML value and store the results into the received XMLDataValue "result" param (assuming "result" is non-null; else create a new XMLDataValue).

public StringDataValue

Returns:

A serialized (to string) version of this XML object, in the form of a StringDataValue object.
XMLSerialize
(StringDataValue
The result of a previous call to this method, null if not called yet.
result
,
int
The string type to which we want to serialize.
targetType
,
int
The width of the target type.
targetWidth
,
int
The collation type of the target type.
targetCollationType
)

The SQL/XML XMLSerialize operator.

Inherited from org.apache.derby.iapi.types.DataValueDescriptor:
checkHostVariablecloneHoldercloneValuecoalescecomparecomparecomparecompareequalsestimateMemoryUsagegetBooleangetBytegetBytesgetDategetDoublegetFloatgetIntgetLengthgetLonggetNewNullgetObjectgetShortgetStreamgetStringgetTimegetTimestampgetTraceStringgetTypeNamegreaterOrEqualsgreaterThanhasStreaminisNotNullisNullOplessOrEqualslessThannormalizenotEqualsreadExternalFromArrayrecyclesetBigDecimalsetIntosetIntosetObjectForCastsetToNullsetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValueFromResultSettypePrecedencetypeToBigDecimal

Method Detail

getXTypeback to summary
public int getXType()

Retrieve this XML value's qualified type.

hasTopLevelAttrback to summary
public boolean hasTopLevelAttr()

Return whether or not this XML value represents a sequence that has one or more top-level attribute nodes.

markAsHavingTopLevelAttrback to summary
public void markAsHavingTopLevelAttr()

Take note of the fact this XML value represents an XML sequence that has one or more top-level attribute nodes.

setXTypeback to summary
public void setXType(int xtype)

Set this XML value's qualified type.

XMLExistsback to summary
public BooleanDataValue XMLExists(SqlXmlUtil sqlxUtil) throws StandardException

The SQL/XML XMLExists operator. Checks to see if evaluation of the query expression contained within the received util object against this XML value returns at least one item.

Note

For now, the query expression must be XPath only (XQuery not supported) because that's what Xalan supports.

Parameters
sqlxUtil:SqlXmlUtil

Contains SQL/XML objects and util methods that facilitate execution of XML-related operations

Returns:BooleanDataValue

True if evaluation of the query expression stored in sqlxUtil returns at least one node for this XML value; unknown if the xml value is NULL; false otherwise.

Exceptions
StandardException:
Thrown on error
XMLParseback to summary
public XMLDataValue XMLParse(StringDataValue stringValue, boolean preserveWS, SqlXmlUtil sqlxUtil) throws StandardException

Method to parse an XML string and, if it's valid, store the _serialized_ version locally and then return this XMLDataValue.

Parameters
stringValue:StringDataValue

The string value to check.

preserveWS:boolean

Whether or not to preserve ignorable whitespace.

sqlxUtil:SqlXmlUtil

Contains SQL/XML objects and util methods that facilitate execution of XML-related operations

Returns:XMLDataValue

If 'text' constitutes a valid XML document, it has been stored in this XML value and this XML value returned; otherwise, an exception is thrown.

Exceptions
StandardException:
Thrown on error.
XMLQueryback to summary
public XMLDataValue XMLQuery(SqlXmlUtil sqlxUtil, XMLDataValue result) throws StandardException

Evaluate the XML query expression contained within the received util object against this XML value and store the results into the received XMLDataValue "result" param (assuming "result" is non-null; else create a new XMLDataValue).

Parameters
sqlxUtil:SqlXmlUtil

Contains SQL/XML objects and util methods that facilitate execution of XML-related operations

result:XMLDataValue

The result of a previous call to this method; null if not called yet.

Returns:XMLDataValue

An XMLDataValue whose content corresponds to the serialized version of the results from evaluation of the query expression.

Note

this XMLDataValue may not be storable into Derby XML columns.

Exceptions
StandardException:
thrown on error
XMLSerializeback to summary
public StringDataValue XMLSerialize(StringDataValue result, int targetType, int targetWidth, int targetCollationType) throws StandardException

The SQL/XML XMLSerialize operator. Serializes this XML value into a string with a user-specified character type, and returns that string via the received StringDataValue (if the received StringDataValue is non-null and of the correct type; else, a new StringDataValue is returned).

Parameters
result:StringDataValue

The result of a previous call to this method, null if not called yet.

targetType:int

The string type to which we want to serialize.

targetWidth:int

The width of the target type.

targetCollationType:int

The collation type of the target type.

Returns:StringDataValue

A serialized (to string) version of this XML object, in the form of a StringDataValue object.

Exceptions
StandardException:
Thrown on error