Package org.postgresql.jdbc
Interface ArrayEncoding.ArrayEncoder<A>
- All Known Implementing Classes:
ArrayEncoding.AbstractArrayEncoder
,ArrayEncoding.FixedSizePrimitiveArrayEncoder
,ArrayEncoding.NumberArrayEncoder
,ArrayEncoding.RecursiveArrayEncoder
,ArrayEncoding.TwoDimensionPrimitiveArrayEncoder
- Enclosing class:
ArrayEncoding
static interface ArrayEncoding.ArrayEncoder<A>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendArray
(StringBuilder sb, char delim, A array) AppendString
representation of array to sb.int
The default array type oid supported by this instance.boolean
supportBinaryRepresentation
(int oid) Indicates if an array can be encoded in binary form to array oid.toArrayString
(char delim, A array) CreatesString
representation of the array.byte[]
toBinaryRepresentation
(BaseConnection connection, A array, int oid) Creates binary representation of the array.
-
Method Details
-
getDefaultArrayTypeOid
int getDefaultArrayTypeOid()The default array type oid supported by this instance.- Returns:
- The default array type oid supported by this instance.
-
toArrayString
CreatesString
representation of the array.- Parameters:
delim
- The character to use to delimit between elements.array
- The array to represent as aString
.- Returns:
String
representation of the array.
-
supportBinaryRepresentation
boolean supportBinaryRepresentation(int oid) Indicates if an array can be encoded in binary form to array oid.- Parameters:
oid
- The array oid to see check for binary support.- Returns:
- Indication of whether
toBinaryRepresentation(BaseConnection, Object, int)
is supported for oid.
-
toBinaryRepresentation
byte[] toBinaryRepresentation(BaseConnection connection, A array, int oid) throws SQLException, SQLFeatureNotSupportedException Creates binary representation of the array.- Parameters:
connection
- The connection the binary representation will be used on. Attributes from the connection might impact how values are translated to binary.array
- The array to binary encode. Must not benull
, but may containnull
elements.oid
- The array type oid to use. Calls tosupportBinaryRepresentation(int)
must have returnedtrue
.- Returns:
- The binary representation of array.
- Throws:
SQLFeatureNotSupportedException
- IfsupportBinaryRepresentation(int)
is false for oid.SQLException
-
appendArray
AppendString
representation of array to sb.- Parameters:
sb
- TheStringBuilder
to append to.delim
- The delimiter between elements.array
- The array to represent. Will not benull
, but may containnull
elements.
-