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 class
XMLType.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 void
free()
InputStream
getBinaryStream()
Reader
getCharacterStream()
String
getEncoding()
static String
getEncoding(InputStream is)
static String
getEncoding(SQLXML xml)
Returns the encoding or null if it cannot be determined<T extends Source>
TgetSource(Class<T> sourceClass)
String
getString()
XMLType.Type
getType()
static XMLInputFactory
getXmlInputFactory()
static boolean
isThreadSafeXmlFactories()
long
length()
void
readExternal(ObjectInput in)
void
readExternal(ObjectInput in, byte version)
protected void
readReference(ObjectInput in)
OutputStream
setBinaryStream()
Writer
setCharacterStream()
void
setEncoding(String encoding)
<T extends Result>
TsetResult(Class<T> resultClass)
void
setString(String value)
void
setType(XMLType.Type type)
void
writeExternal(ObjectOutput out)
void
writeExternal(ObjectOutput out, byte version)
protected void
writeReference(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:
getBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
getCharacterStream
public Reader getCharacterStream() throws SQLException
- Specified by:
getCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
getSource
public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException
- Specified by:
getSource
in interfaceSQLXML
- Throws:
SQLException
-
getString
public String getString() throws SQLException
- Specified by:
getString
in interfaceSQLXML
- Throws:
SQLException
-
setBinaryStream
public OutputStream setBinaryStream() throws SQLException
- Specified by:
setBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
setCharacterStream
public Writer setCharacterStream() throws SQLException
- Specified by:
setCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
setString
public void setString(String value) throws SQLException
- Specified by:
setString
in interfaceSQLXML
- Throws:
SQLException
-
free
public void free() throws SQLException
- Specified by:
free
in interfaceSQLXML
- Throws:
SQLException
-
setResult
public <T extends Result> T setResult(Class<T> resultClass) throws SQLException
- Specified by:
setResult
in 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:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classStreamable<SQLXML>
- Throws:
IOException
ClassNotFoundException
-
readExternal
public void readExternal(ObjectInput in, byte version) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in 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:
readReference
in classStreamable<SQLXML>
- Throws:
IOException
-
writeReference
protected void writeReference(DataOutput out) throws IOException
- Specified by:
writeReference
in classStreamable<SQLXML>
- Throws:
IOException
-
length
public long length() throws SQLException
- Overrides:
length
in classStreamable<SQLXML>
- Throws:
SQLException
-
-