| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private boolean | |
| private SqlXmlUtil | |
| protected static final short | |
| public static final int | |
| public static final int | |
| private static String | |
| private SQLChar | |
| public static final short | |
| public static final short | |
| public static final short | |
| public static final short | |
| public static final short | |
| public static final short | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| private | XML(SQLChar
A SQLChar instance to clone and use for
this XML value. val, int Qualified XML type for "val" xmlType, boolean Whether or not "val" corresponds to
sequence with one or more top-level attribute nodes. seqWithAttr, boolean whether or not to force materialization of the
underlying source data materialize)Private constructor used for the |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | Returns: true if JAXP is installed, or false otherwiseCheck if we have a JAXP implementation installed. |
| public static void | |
| private static boolean | Returns: true if XPath is supported, or false otherwiseCheck if XPath is supported on this platform. |
| public DataValueDescriptor | cloneValue(boolean
any streams representing the data value will
be materialized if forceMaterialization)true, the data value will be kept as a
stream if possible if falseImplements org. Clone this DataValueDescriptor. |
| public int | compare(DataValueDescriptor
The Orderable to compare this one to. other)Implements org. Compare two XML DataValueDescriptors. |
| public int | estimateMemoryUsage()
Implements org. Estimate the memory usage in bytes of the data value and the overhead of the class. |
| public int | getLength()
Implements org. Gets the length of the data value. |
| public DataValueDescriptor | getNewNull()
Implements org. Get a new null value of the same type as this data value. |
| public String | getString()
Implements org. Gets the value in the data value descriptor as a String. |
| public int | getTypeFormatId()
Implements org. Get a universally unique identifier for the type of this object. |
| public String | getTypeName()
Implements org. Get the SQL name of the datatype |
| public int | getXType()
Implements org. Retrieve this XML value's qualified type. |
| public boolean | hasTopLevelAttr()
Implements org. Return whether or not this XML value represents a sequence that has one or more top-level attribute nodes. |
| public boolean | isNull()
Implements org. Return whether the value is null or not. |
| public void | loadStream()
Implements org. Set the value by reading the stream and converting it to an object form. |
| public void | markAsHavingTopLevelAttr()
Implements org. Take note of the fact this XML value represents an XML sequence that has one or more top-level attribute nodes. |
| public void | normalize(DataTypeDescriptor
The type to normalize the source column to desiredType, DataValueDescriptor The value to normalize source)Overrides org. Implements org. Normalization method - this method will always be called when storing an XML value into an XML column, for example, when inserting/updating. |
| public void | readExternal(ObjectInput
The stream from which we're reading. in)Implements java. Read an XML value from an input stream. |
| public void | readExternalFromArray(ArrayInputStream
The array stream positioned at the beginning of the
byte stream to read from. in)Overrides org. Implements org. Read the DataValueDescriptor from the stream. |
| public void | restoreToNull()
Implements org. Restore this object to its (SQL)null value. |
| public InputStream | returnStream()
Implements org. Return the on-disk stream state of the object. |
| protected void | setFrom(DataValueDescriptor
The DataValueDescriptor that holds the value to
which we want to set this DataValueDescriptor's value. theValue)Overrides org. Set the value of this DataValueDescriptor based on the value of the specified DataValueDescriptor. |
| public void | setStream(InputStream
The new stream to use newStream)Implements org. sets the on-disk stream state for the object. |
| public final void | setValueFromResultSet(ResultSet
The specified ResultSet. resultSet, int The 1-based column # into the resultSet. colNumber, boolean Whether or not the column is nullable
(No need to call wasNull() if not) isNullable)Implements org. Set the value based on the value for the specified DataValueDescriptor from the specified ResultSet. |
| public void | setXType(int xtype)
Implements org. Set this XML value's qualified type. |
| public int | typePrecedence()
Overrides org. Implements org. Each built-in type in JSQL has a precedence. |
| public void | writeExternal(ObjectOutput
The stream to which we're writing. out)Implements java. Write an XML value. |
| 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.Contains SQL/XML objects and util
methods that facilitate execution of XML-related
operations sqlxUtil)Implements org. 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 is returned; otherwise, an exception is thrown.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)Implements org. 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. 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)Implements org. 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.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)Implements org. The SQL/XML XMLSerialize operator. |
| BASE_MEMORY_USAGE | back to summary |
|---|---|
| private static final int BASE_MEMORY_USAGE | |
| containsTopLevelAttr | back to summary |
|---|---|
| private boolean containsTopLevelAttr | |
| tmpUtil | back to summary |
|---|---|
| private SqlXmlUtil tmpUtil | |
| UTF8_IMPL_ID | back to summary |
|---|---|
| protected static final short UTF8_IMPL_ID | |
| XML_DOC_ANY | back to summary |
|---|---|
| public static final int XML_DOC_ANY | |
| XML_SEQUENCE | back to summary |
|---|---|
| public static final int XML_SEQUENCE | |
| xmlReqCheck | back to summary |
|---|---|
| private static String xmlReqCheck | |
| xmlStringValue | back to summary |
|---|---|
| private SQLChar xmlStringValue | |
| XQ_EMPTY_ON_EMPTY | back to summary |
|---|---|
| public static final short XQ_EMPTY_ON_EMPTY | |
| XQ_NULL_ON_EMPTY | back to summary |
|---|---|
| public static final short XQ_NULL_ON_EMPTY | |
| XQ_PASS_BY_REF | back to summary |
|---|---|
| public static final short XQ_PASS_BY_REF | |
| XQ_PASS_BY_VALUE | back to summary |
|---|---|
| public static final short XQ_PASS_BY_VALUE | |
| XQ_RETURN_CONTENT | back to summary |
|---|---|
| public static final short XQ_RETURN_CONTENT | |
| XQ_RETURN_SEQUENCE | back to summary |
|---|---|
| public static final short XQ_RETURN_SEQUENCE | |
| xType | back to summary |
|---|---|
| private int xType | |
| XML | back to summary |
|---|---|
| public XML() Default constructor. | |
| XML | back to summary |
|---|---|
| private XML(SQLChar val, int xmlType, boolean seqWithAttr, boolean materialize) Private constructor used for the
| |
| checkJAXPRequirement | back to summary |
|---|---|
| private static boolean checkJAXPRequirement() Check if we have a JAXP implementation installed.
| |
| checkXMLRequirements | back to summary |
|---|---|
| public static void checkXMLRequirements() throws StandardException See if the required JAXP and Xalan classes are in the user's classpath. Assumption is that we will always call this method before instantiating an instance of SqlXmlUtil, and thus we will never get a ClassNotFound exception caused by missing JAXP/Xalan classes. Instead, if either is missing we should throw an informative error indicating what the problem is. Note This method only does the checks necessary to allow successful instantiation of the SqlXmlUtil class. Further checks (esp. the presence of a JAXP _implementation_ in addition to the JAXP _interfaces_) are performed in the SqlXmlUtil constructor.
| |
| checkXPathRequirement | back to summary |
|---|---|
| private static boolean checkXPathRequirement() Check if XPath is supported on this platform.
| |
| cloneValue | back to summary |
|---|---|
| public DataValueDescriptor cloneValue(boolean forceMaterialization) Implements org. Doc from org. Clone this DataValueDescriptor. Results in a new object that has the same value as this but can be modified independently.
Even though the objects can be modified independently regardless of the
value of
| |
| compare | back to summary |
|---|---|
| public int compare(DataValueDescriptor other) throws StandardException Implements org. Compare two XML DataValueDescriptors. Note This method should only be used by the database store for the purpose of index positioning--comparisons of XML type are not allowed from the language side of things. That said, all store wants to do is order the NULLs, so we don't actually have to do a full comparison. Just return an order value based on whether or not this XML value and the other XML value are null. As mentioned in the "compare" method of DataValueDescriptor, nulls are considered equal to other nulls and less than all other values. An example of when this method might be used is if the user executed a query like: select i from x_table where x_col is not null
| |
| estimateMemoryUsage | back to summary |
|---|---|
| public int estimateMemoryUsage() Implements org. Doc from org. Estimate the memory usage in bytes of the data value and the overhead of the class.
| |
| getLength | back to summary |
|---|---|
| public int getLength() throws StandardException Implements org. Doc from org. Gets the length of the data value. The meaning of this is implementation-dependent. For string types, it is the number of characters in the string. For numeric types, it is the number of bytes used to store the number. This is the actual length of this value, not the length of the type it was defined as. For example, a VARCHAR value may be shorter than the declared VARCHAR (maximum) length.
| |
| getNewNull | back to summary |
|---|---|
| public DataValueDescriptor getNewNull() Implements org. Doc from org. Get a new null value of the same type as this data value.
| |
| getString | back to summary |
|---|---|
| public String getString() throws StandardException Implements org. Doc from org. Gets the value in the data value descriptor as a String. Throws an exception if the data value is not a string.
| |
| getTypeFormatId | back to summary |
|---|---|
| public int getTypeFormatId() Implements org. Doc from org. Get a universally unique identifier for the type of this object.
| |
| getTypeName | back to summary |
|---|---|
| public String getTypeName() Implements org. Doc from org. Get the SQL name of the datatype
| |
| getXType | back to summary |
|---|---|
| public int getXType() Implements org. Retrieve this XML value's qualified type. | |
| hasTopLevelAttr | back to summary |
|---|---|
| public boolean hasTopLevelAttr() Implements org. Return whether or not this XML value represents a sequence that has one or more top-level attribute nodes. | |
| isNull | back to summary |
|---|---|
| public boolean isNull() Implements org. Doc from org. Return whether the value is null or not.
| |
| loadStream | back to summary |
|---|---|
| public void loadStream() throws StandardException Implements org. Doc from org. Set the value by reading the stream and converting it to an object form.
| |
| markAsHavingTopLevelAttr | back to summary |
|---|---|
| public void markAsHavingTopLevelAttr() Implements org. Take note of the fact this XML value represents an XML sequence that has one or more top-level attribute nodes. | |
| normalize | back to summary |
|---|---|
| public void normalize(DataTypeDescriptor desiredType, DataValueDescriptor source) throws StandardException Overrides org. Implements org. Normalization method - this method will always be called when storing an XML value into an XML column, for example, when inserting/updating. We always force normalization in this case because we need to make sure the qualified type of the value we're trying to store is XML_DOC_ANY--we don't allow anything else.
| |
| readExternal | back to summary |
|---|---|
| public void readExternal(ObjectInput in) throws IOException Implements java. Read an XML value from an input stream.
| |
| readExternalFromArray | back to summary |
|---|---|
| public void readExternalFromArray(ArrayInputStream in) throws IOException Overrides org. Implements org. Doc from org. Read the DataValueDescriptor from the stream. Initialize the data value by reading it's values from the ArrayInputStream. This interface is provided as a way to achieve possible performance enhancement when reading an array can be optimized over reading from a generic stream from readExternal().
| |
| restoreToNull | back to summary |
|---|---|
| public void restoreToNull() Implements org. Doc from org. Restore this object to its (SQL)null value.
| |
| returnStream | back to summary |
|---|---|
| public InputStream returnStream() Implements org. Doc from org. Return the on-disk stream state of the object.
| |
| setFrom | back to summary |
|---|---|
| protected void setFrom(DataValueDescriptor theValue) throws StandardException Overrides org. Doc from org. Set the value of this DataValueDescriptor based on the value of the specified DataValueDescriptor.
| |
| setStream | back to summary |
|---|---|
| public void setStream(InputStream newStream) Implements org. Doc from org. sets the on-disk stream state for the object.
| |
| setValueFromResultSet | back to summary |
|---|---|
| public final void setValueFromResultSet(ResultSet resultSet, int colNumber, boolean isNullable) throws SQLException Implements org. Doc from org. Set the value based on the value for the specified DataValueDescriptor from the specified ResultSet.
| |
| setXType | back to summary |
|---|---|
| public void setXType(int xtype) Implements org. Set this XML value's qualified type. | |
| typePrecedence | back to summary |
|---|---|
| public int typePrecedence() Overrides org. Implements org. Doc from org. Each built-in type in JSQL has a precedence. This precedence determines how to do type promotion when using binary operators. For example, float has a higher precedence than int, so when adding an int to a float, the result type is float. The precedence for some types is arbitrary. For example, it doesn't matter what the precedence of the boolean type is, since it can't be mixed with other types. But the precedence for the number types is critical. The SQL standard requires that exact numeric types be promoted to approximate numeric when one operator uses both. Also, the precedence is arranged so that one will not lose precision when promoting a type.
| |
| writeExternal | back to summary |
|---|---|
| public void writeExternal(ObjectOutput out) throws IOException Implements java. Write an XML value.
| |
| XMLExists | back to summary |
|---|---|
| public BooleanDataValue XMLExists(SqlXmlUtil sqlxUtil) throws StandardException Implements org. 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.
| |
| XMLParse | back to summary |
|---|---|
| public XMLDataValue XMLParse(StringDataValue stringValue, boolean preserveWS, SqlXmlUtil sqlxUtil) throws StandardException Implements org. Method to parse an XML string and, if it's valid, store the _serialized_ version locally and then return this XMLDataValue.
| |
| XMLQuery | back to summary |
|---|---|
| public XMLDataValue XMLQuery(SqlXmlUtil sqlxUtil, XMLDataValue result) throws StandardException Implements org. 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).
| |
| XMLSerialize | back to summary |
|---|---|
| public StringDataValue XMLSerialize(StringDataValue result, int targetType, int targetWidth, int targetCollationType) throws StandardException Implements org. 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).
| |