Class SQLXMLImpl<V extends Datum>

java.lang.Object
org.postgresql.pljava.jdbc.SQLXMLImpl<V>
All Implemented Interfaces:
SQLXML

public abstract class SQLXMLImpl<V extends Datum> extends Object implements SQLXML
Implementation of SQLXML for the SPI connection.
  • Field Details

    • m_backing

      protected volatile V extends Datum m_backing
  • Constructor Details

    • SQLXMLImpl

      protected SQLXMLImpl(V backing)
  • Method Details

    • free

      public void free() throws SQLException
      Specified by:
      free in interface SQLXML
      Throws:
      SQLException
    • getBinaryStream

      public InputStream getBinaryStream() throws SQLException
      Specified by:
      getBinaryStream in interface SQLXML
      Throws:
      SQLException
    • setBinaryStream

      public OutputStream setBinaryStream() throws SQLException
      Specified by:
      setBinaryStream in interface SQLXML
      Throws:
      SQLException
    • getCharacterStream

      public Reader getCharacterStream() throws SQLException
      Specified by:
      getCharacterStream in interface SQLXML
      Throws:
      SQLException
    • setCharacterStream

      public Writer setCharacterStream() throws SQLException
      Specified by:
      setCharacterStream in interface SQLXML
      Throws:
      SQLException
    • getString

      public String getString() throws SQLException
      Specified by:
      getString in interface SQLXML
      Throws:
      SQLException
    • setString

      public void setString(String value) throws SQLException
      Specified by:
      setString in interface SQLXML
      Throws:
      SQLException
    • getSource

      public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException
      Specified by:
      getSource in interface SQLXML
      Throws:
      SQLException
    • setResult

      public <T extends Result> T setResult(Class<T> resultClass) throws SQLException
      Specified by:
      setResult in interface SQLXML
      Throws:
      SQLException
    • backingIfNotFreed

      protected V backingIfNotFreed() throws SQLException
      Throws:
      SQLException
    • newReadable

      public static <T extends InputStream & Datum> SQLXML newReadable(Datum.Input<T> datum, RegType pgType, boolean synthetic) throws SQLException
      Create readable SQLXML instance over a Datum.Input, recording the source type.

      The source type can be used to detect efforts to store this value into a destination of a different type, and apply a verifier for type safety.

      Throws:
      SQLException
    • newWritable

      public static SQLXML newWritable()
      Create a new, initially empty and writable, SQLXML instance, whose backing memory will in a transaction-scoped PostgreSQL memory context.
    • adopt

      protected abstract Datum adopt(int oid) throws SQLException
      Allow native code to claim complete control over the underlying Datum 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 Datum (which has its own adopt method the native code will call next.
      Throws:
      SQLException - if this SQLXML 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).
      Overrides:
      toString in class Object
    • 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 object o; the normal Java toString() will pass this.

      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. Passing null is the same as passing this.
      Returns:
      Description of this object for debugging convenience.