Package org.postgresql.pljava.internal
Interface VarlenaWrapper
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
PgNodeTreeAsXML
,VarlenaWrapper.Input
,VarlenaWrapper.Input.Stream
,VarlenaWrapper.Output
,VarlenaXMLRenderer
public interface VarlenaWrapper extends Closeable
Interface that wraps a PostgreSQL native variable-length ("varlena") datum; implementing classes present an existing one to Java as a readableInputStream
, or allow a new one to be constructed by presenting a writableOutputStream
.Common to both is a method
adopt()
, allowing native code to reassert control over the varlena (for the writable variety, after Java code has written and closed it), after which it is no longer accessible from Java.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
VarlenaWrapper.Input
A class by which Java reads the content of a varlena.static class
VarlenaWrapper.Output
A class by which Java writes the content of a varlena as an OutputStream.static class
VarlenaWrapper.Verifier
AVerifier
verifies the proper form of content written to aVarlenaWrapper.Output
.
-
Method Summary
Modifier and Type Method Description long
adopt(DualState.Key cookie)
Return the varlena address to native code and dissociate the varlena from Java.String
toString(Object o)
Return a string describing this object in a way useful for debugging, prefixed with the name (abbreviated for comfort) of the class of the object passed in (the normal JavatoString()
method should passthis
).
-
-
-
Method Detail
-
adopt
long adopt(DualState.Key cookie) throws SQLException
Return the varlena address to native code and dissociate the varlena from Java.- Parameters:
cookie
- Capability held by native code.- Throws:
SQLException
-
toString
String toString(Object o)
Return a string describing this object in a way useful for debugging, prefixed with the name (abbreviated for comfort) of the class of the object passed in (the normal JavatoString()
method should passthis
).Subclasses or consumers are encouraged to call this method and append further details specific to the subclass or consumer. The convention should be that the recursion will stop at some class that will actually construct the abbreviated class name of
o
and use it to prefix the returned value.- Parameters:
o
- An object whose class name (possibly abbreviated) should be used to prefix the returned string.- Returns:
- Description of this object.
-
-