|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.common.sql.filters.AbstractBlobFilter org.objectweb.cjdbc.common.sql.filters.BlobEscapedFilter
This class defines a BlobEscapedFilter. It acts just the same as the
NoneBlobFilter
except that the content is escaped to prevent
strange characters for disturbing the data. This has been adapted mainly for
PostgreSQL bytea data, but it should be usable for any other database.
Constructor Summary | |
BlobEscapedFilter()
|
Method Summary | |
byte[] |
decode(byte[] data)
Decode the blob data from the database. |
byte[] |
decode(java.lang.String data)
Decode the blob data from the database. |
java.lang.String |
encode(byte[] data)
Encode the blob data in a form that is independant of the database. |
java.lang.String |
encode(java.lang.String data)
Encode the blob data in a form that is independant of the database. |
java.lang.String |
getXml()
Get the XML attribute value of the filter as defined in the DTD. |
static byte[] |
toBytes(byte[] s)
Converts a PG bytea raw value (i.e. the raw binary representation of the bytea data type) into a java byte[]. |
static java.lang.String |
toPGString(byte[] postgresBuf)
Converts a java byte[] into a PG bytea string (i.e. the text representation of the bytea data type). |
Methods inherited from class org.objectweb.cjdbc.common.sql.filters.AbstractBlobFilter |
getBlobFilterInstance |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BlobEscapedFilter()
Method Detail |
public java.lang.String encode(byte[] data)
AbstractBlobFilter
encode
in class AbstractBlobFilter
data
- the byte array to convert
String
object is returned for convenience as this is
the way it is going to be handled afterwards.AbstractBlobFilter.encode(byte[])
public java.lang.String encode(java.lang.String data)
AbstractBlobFilter
encode
in class AbstractBlobFilter
data
- the byte array to convert
String
object is returned for convenience as this is
the way it is going to be handled afterwards.AbstractBlobFilter.encode(java.lang.String)
public byte[] decode(byte[] data)
AbstractBlobFilter
decode
in class AbstractBlobFilter
data
- the data to decode
byte[]
decoded byte array of dataAbstractBlobFilter.decode(byte[])
public byte[] decode(java.lang.String data)
AbstractBlobFilter
decode
in class AbstractBlobFilter
data
- the data to decode
byte[]
decoded byte array of dataAbstractBlobFilter.decode(java.lang.String)
public java.lang.String getXml()
AbstractBlobFilter
getXml
in class AbstractBlobFilter
AbstractBlobFilter.getXml()
public static java.lang.String toPGString(byte[] postgresBuf)
postgresBuf
- The byte array to be converted
public static byte[] toBytes(byte[] s)
s
- The byte array to be converted.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |