Package org.postgresql.pljava.jdbc
Class SQLXMLImpl<V extends VarlenaWrapper>
- java.lang.Object
-
- org.postgresql.pljava.jdbc.SQLXMLImpl<V>
-
- All Implemented Interfaces:
SQLXML
public abstract class SQLXMLImpl<V extends VarlenaWrapper> extends Object implements SQLXML
Implementation ofSQLXML
for the SPI connection.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SQLXMLImpl(V backing)
-
Method Summary
Modifier and Type Method Description protected abstract VarlenaWrapper
adopt(int oid)
Allow native code to claim complete control over the underlyingVarlenaWrapper
and dissociate it from Java.protected V
backingIfNotFreed()
void
free()
InputStream
getBinaryStream()
Reader
getCharacterStream()
<T extends Source>
TgetSource(Class<T> sourceClass)
String
getString()
OutputStream
setBinaryStream()
Writer
setCharacterStream()
<T extends Result>
TsetResult(Class<T> resultClass)
void
setString(String value)
String
toString()
Return a description of this object useful for debugging (not the raw XML content).protected String
toString(Object o)
Return information about this object useful for debugging, prefixed with a possibly shortened form of the class name of the passed objecto
; the normal JavatoString()
will passthis
.
-
-
-
Field Detail
-
m_backing
protected volatile V extends VarlenaWrapper m_backing
-
-
Constructor Detail
-
SQLXMLImpl
protected SQLXMLImpl(V backing)
-
-
Method Detail
-
free
public void free() throws SQLException
- Specified by:
free
in interfaceSQLXML
- Throws:
SQLException
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
- Specified by:
getBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
setBinaryStream
public OutputStream setBinaryStream() throws SQLException
- Specified by:
setBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
getCharacterStream
public Reader getCharacterStream() throws SQLException
- Specified by:
getCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
setCharacterStream
public Writer setCharacterStream() throws SQLException
- Specified by:
setCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
getString
public String getString() throws SQLException
- Specified by:
getString
in interfaceSQLXML
- Throws:
SQLException
-
setString
public void setString(String value) throws SQLException
- Specified by:
setString
in interfaceSQLXML
- Throws:
SQLException
-
getSource
public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException
- Specified by:
getSource
in interfaceSQLXML
- Throws:
SQLException
-
setResult
public <T extends Result> T setResult(Class<T> resultClass) throws SQLException
- Specified by:
setResult
in interfaceSQLXML
- Throws:
SQLException
-
backingIfNotFreed
protected V backingIfNotFreed() throws SQLException
- Throws:
SQLException
-
adopt
protected abstract VarlenaWrapper adopt(int oid) throws SQLException
Allow native code to claim complete control over the underlyingVarlenaWrapper
and dissociate it from Java.- Parameters:
oid
- The PostgreSQL type ID the native code is expecting; see Readable.adopt for why that can matter.- Returns:
- The underlying
VarlenaWrapper
(which has its ownadopt
method the native code will call next. - Throws:
SQLException
- if thisSQLXML
instance is not in the proper state to be adoptable.
-
toString
public String toString()
Return a description of this object useful for debugging (not the raw XML content).
-
toString
protected String toString(Object o)
Return information about this object useful for debugging, prefixed with a possibly shortened form of the class name of the passed objecto
; the normal JavatoString()
will passthis
.Subclasses are encouraged to override, call the super method and append subclass-specific detail.
- Parameters:
o
- Object whose class name should be used to prefix the returned string. Passingnull
is the same as passingthis
.- Returns:
- Description of this object for debugging convenience.
-
-