Package org.postgresql.pljava.internal
Interface VarlenaWrapper
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
PgNodeTreeAsXML
,VarlenaWrapper.Input
,VarlenaWrapper.Input.Stream
,VarlenaWrapper.Output
,VarlenaXMLRenderer
Interface that wraps a PostgreSQL native variable-length ("varlena") datum;
implementing classes present an existing one to Java as a readable
InputStream
, or allow a new one to be constructed by presenting a
writable OutputStream
.
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 ClassesModifier and TypeInterfaceDescriptionstatic class
A class by which Java reads the content of a varlena.static class
A class by which Java writes the content of a varlena as an OutputStream.static class
AVerifier
verifies the proper form of content written to aVarlenaWrapper.Output
. -
Method Summary
Modifier and TypeMethodDescriptionlong
adopt
(DualState.Key cookie) Return the varlena address to native code and dissociate the varlena from Java.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 Details
-
adopt
Return the varlena address to native code and dissociate the varlena from Java.- Parameters:
cookie
- Capability held by native code.- Throws:
SQLException
-
toString
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.
-