Package org.teiid.core.types
Class XMLType
- java.lang.Object
-
- org.teiid.core.types.Streamable<SQLXML>
-
- org.teiid.core.types.XMLType
-
- All Implemented Interfaces:
Externalizable,Serializable,SQLXML
public final class XMLType extends Streamable<SQLXML> implements SQLXML
This class represents the SQLXML object along with the Streamable interface. NOTE that this representation of XML does not become unreadable after read operations.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXMLType.Type
-
Field Summary
-
Fields inherited from class org.teiid.core.types.Streamable
CHARSET, ENCODING, length, reference, STREAMING_BATCH_SIZE_IN_BYTES
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfree()InputStreamgetBinaryStream()ReadergetCharacterStream()StringgetEncoding()static StringgetEncoding(InputStream is)static StringgetEncoding(SQLXML xml)Returns the encoding or null if it cannot be determined<T extends Source>
TgetSource(Class<T> sourceClass)StringgetString()XMLType.TypegetType()static XMLInputFactorygetXmlInputFactory()static booleanisThreadSafeXmlFactories()longlength()voidreadExternal(ObjectInput in)voidreadExternal(ObjectInput in, byte version)protected voidreadReference(ObjectInput in)OutputStreamsetBinaryStream()WritersetCharacterStream()voidsetEncoding(String encoding)<T extends Result>
TsetResult(Class<T> resultClass)voidsetString(String value)voidsetType(XMLType.Type type)voidwriteExternal(ObjectOutput out)voidwriteExternal(ObjectOutput out, byte version)protected voidwriteReference(DataOutput out)-
Methods inherited from class org.teiid.core.types.Streamable
getLength, getReference, getReferenceStreamId, isBinary, setReference, setReferenceStreamId, toString
-
-
-
-
Constructor Detail
-
XMLType
public XMLType()
-
XMLType
public XMLType(SQLXML xml)
-
-
Method Detail
-
isThreadSafeXmlFactories
public static boolean isThreadSafeXmlFactories()
-
getXmlInputFactory
public static XMLInputFactory getXmlInputFactory()
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
- Specified by:
getBinaryStreamin interfaceSQLXML- Throws:
SQLException
-
getCharacterStream
public Reader getCharacterStream() throws SQLException
- Specified by:
getCharacterStreamin interfaceSQLXML- Throws:
SQLException
-
getSource
public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException
- Specified by:
getSourcein interfaceSQLXML- Throws:
SQLException
-
getString
public String getString() throws SQLException
- Specified by:
getStringin interfaceSQLXML- Throws:
SQLException
-
setBinaryStream
public OutputStream setBinaryStream() throws SQLException
- Specified by:
setBinaryStreamin interfaceSQLXML- Throws:
SQLException
-
setCharacterStream
public Writer setCharacterStream() throws SQLException
- Specified by:
setCharacterStreamin interfaceSQLXML- Throws:
SQLException
-
setString
public void setString(String value) throws SQLException
- Specified by:
setStringin interfaceSQLXML- Throws:
SQLException
-
free
public void free() throws SQLException- Specified by:
freein interfaceSQLXML- Throws:
SQLException
-
setResult
public <T extends Result> T setResult(Class<T> resultClass) throws SQLException
- Specified by:
setResultin interfaceSQLXML- Throws:
SQLException
-
getType
public XMLType.Type getType()
-
setType
public void setType(XMLType.Type type)
-
getEncoding
public String getEncoding()
-
setEncoding
public void setEncoding(String encoding)
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classStreamable<SQLXML>- Throws:
IOExceptionClassNotFoundException
-
readExternal
public void readExternal(ObjectInput in, byte version) throws IOException, ClassNotFoundException
- Throws:
IOExceptionClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classStreamable<SQLXML>- Throws:
IOException
-
writeExternal
public void writeExternal(ObjectOutput out, byte version) throws IOException
- Throws:
IOException
-
getEncoding
public static String getEncoding(SQLXML xml)
Returns the encoding or null if it cannot be determined- Parameters:
xml-
-
getEncoding
public static String getEncoding(InputStream is)
-
readReference
protected void readReference(ObjectInput in) throws IOException
- Specified by:
readReferencein classStreamable<SQLXML>- Throws:
IOException
-
writeReference
protected void writeReference(DataOutput out) throws IOException
- Specified by:
writeReferencein classStreamable<SQLXML>- Throws:
IOException
-
length
public long length() throws SQLException- Overrides:
lengthin classStreamable<SQLXML>- Throws:
SQLException
-
-