Class PassXML.SQLXMLMock
- java.lang.Object
-
- org.postgresql.pljava.example.annotation.PassXML.SQLXMLMock
-
- All Implemented Interfaces:
SQLXML
- Enclosing class:
- PassXML
public static class PassXML.SQLXMLMock extends Object implements SQLXML
Class that will mock anSQLXML
instance, returning only binary or character stream data from a byte array or string supplied at construction.
-
-
Constructor Summary
Constructors Constructor Description SQLXMLMock(byte[] content)
SQLXMLMock(String content)
-
Method Summary
Modifier and Type Method Description void
free()
InputStream
getBinaryStream()
Reader
getCharacterStream()
<T extends Source>
TgetSource(Class<T> sourceClass)
String
getString()
OutputStream
setBinaryStream()
Writer
setCharacterStream()
<T extends Result>
TsetResult(Class<T> resultClass)
void
setString(String value)
-
-
-
Constructor Detail
-
SQLXMLMock
public SQLXMLMock(String content)
-
SQLXMLMock
public SQLXMLMock(byte[] content)
-
-
Method Detail
-
free
public void free() throws SQLException
- Specified by:
free
in interfaceSQLXML
- Throws:
SQLException
-
getBinaryStream
public InputStream getBinaryStream() throws SQLException
- Specified by:
getBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
setBinaryStream
public OutputStream setBinaryStream() throws SQLException
- Specified by:
setBinaryStream
in interfaceSQLXML
- Throws:
SQLException
-
getCharacterStream
public Reader getCharacterStream() throws SQLException
- Specified by:
getCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
setCharacterStream
public Writer setCharacterStream() throws SQLException
- Specified by:
setCharacterStream
in interfaceSQLXML
- Throws:
SQLException
-
getString
public String getString() throws SQLException
- Specified by:
getString
in interfaceSQLXML
- Throws:
SQLException
-
setString
public void setString(String value) throws SQLException
- Specified by:
setString
in interfaceSQLXML
- Throws:
SQLException
-
getSource
public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException
- Specified by:
getSource
in interfaceSQLXML
- Throws:
SQLException
-
setResult
public <T extends Result> T setResult(Class<T> resultClass) throws SQLException
- Specified by:
setResult
in interfaceSQLXML
- Throws:
SQLException
-
-