Package org.postgresql.pljava.internal
Class VarlenaXMLRenderer
- java.lang.Object
-
- org.postgresql.pljava.internal.SyntheticXMLReader
-
- org.postgresql.pljava.internal.ByteBufferXMLReader
-
- org.postgresql.pljava.internal.VarlenaXMLRenderer
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,VarlenaWrapper
,XMLReader
- Direct Known Subclasses:
PgNodeTreeAsXML
public abstract class VarlenaXMLRenderer extends ByteBufferXMLReader implements VarlenaWrapper
Class adapting aByteBufferXMLReader
to aVarlenaWrapper.Input
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.postgresql.pljava.internal.SyntheticXMLReader
SyntheticXMLReader.ApacheFeature, SyntheticXMLReader.EmptyAttributes2, SyntheticXMLReader.EventCarrier, SyntheticXMLReader.FluentAttributes2, SyntheticXMLReader.SAX2FEATURE, SyntheticXMLReader.SAX2PROPERTY
-
Nested classes/interfaces inherited from interface org.postgresql.pljava.internal.VarlenaWrapper
VarlenaWrapper.Input, VarlenaWrapper.Output, VarlenaWrapper.Verifier
-
-
Field Summary
Fields Modifier and Type Field Description protected CharsetDecoder
m_decoder
-
Fields inherited from class org.postgresql.pljava.internal.SyntheticXMLReader
m_attributes, NO_ATTRIBUTES
-
-
Constructor Summary
Constructors Constructor Description VarlenaXMLRenderer(VarlenaWrapper.Input input)
-
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.protected ByteBuffer
buffer()
Return theByteBuffer
being wrapped.void
close()
protected void
pin()
Pin resources as needed during a reading operation.String
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
).protected void
unpin()
Unpin resources after a reading operation.-
Methods inherited from class org.postgresql.pljava.internal.ByteBufferXMLReader
next, next, parse
-
Methods inherited from class org.postgresql.pljava.internal.SyntheticXMLReader
exceptionCarrier, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getProperty, parse, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty, sourceToReader, sysIdToInputStream, sysIdToReader
-
-
-
-
Field Detail
-
m_decoder
protected final CharsetDecoder m_decoder
-
-
Constructor Detail
-
VarlenaXMLRenderer
public VarlenaXMLRenderer(VarlenaWrapper.Input input) throws SQLException
- Throws:
SQLException
-
-
Method Detail
-
adopt
public long adopt(DualState.Key cookie) throws SQLException
Description copied from interface:VarlenaWrapper
Return the varlena address to native code and dissociate the varlena from Java.- Specified by:
adopt
in interfaceVarlenaWrapper
- Parameters:
cookie
- Capability held by native code.- Throws:
SQLException
-
toString
public String toString(Object o)
Description copied from interface:VarlenaWrapper
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.- Specified by:
toString
in interfaceVarlenaWrapper
- Parameters:
o
- An object whose class name (possibly abbreviated) should be used to prefix the returned string.- Returns:
- Description of this object.
-
pin
protected void pin() throws SQLException
Description copied from class:ByteBufferXMLReader
Pin resources as needed during a reading operation.The implementation is also responsible for tracking whether this instance has been closed, and throwing an exception if so.
- Specified by:
pin
in classByteBufferXMLReader
- Throws:
SQLException
-
unpin
protected void unpin()
Description copied from class:ByteBufferXMLReader
Unpin resources after a reading operation.- Specified by:
unpin
in classByteBufferXMLReader
-
buffer
protected ByteBuffer buffer() throws SQLException
Description copied from class:ByteBufferXMLReader
Return theByteBuffer
being wrapped.All uses of the buffer in this class are preceded by
pin()
and followed byunpin()
.- Specified by:
buffer
in classByteBufferXMLReader
- Throws:
SQLException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-