|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mockrunner.jdbc.XMLResultSetFactory
public class XMLResultSetFactory
Can be used to create a ResultSet
based on
a an XML Document
of the proper format. You can specify
the dialect, for proper parsing of the document. Furthermore you can
specify the dialect of the ResultSet
, which determines
the expected format of the XML Document
and whether or not
the column entries should be trimmed (default is true
).
The file can be specified directly or by its name. The class
tries to find the file in the absolut or relative path and
(if not found) by calling getResource
. Note that the
file must exist in the local file system and cannot be loaded from
inside a jar archive.
Field Summary | |
---|---|
static int |
SYBASE_DIALECT
|
Constructor Summary | |
---|---|
XMLResultSetFactory(java.io.File file)
|
|
XMLResultSetFactory(java.lang.String fileName)
|
Method Summary | |
---|---|
MockResultSet |
create(java.lang.String id)
Makes and returns a MockResultSet created from an existing and valid XML Document . |
MockResultSet |
createSybaseResultSet(java.lang.String id)
Return a MockResultSet with proper column names and rows based on the XML Document . |
int |
getDialect()
Get the dialect of the XML Document
|
boolean |
getTrim()
Get whether or not trim is true or false. |
java.io.File |
getXMLFile()
Get the File being used to read in the
ResultSet . |
void |
setDialect(int dialect)
Set the dialect of the XML Document . |
void |
setTrim(boolean trim)
Set if the column entries should be trimmed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SYBASE_DIALECT
Constructor Detail |
---|
public XMLResultSetFactory(java.lang.String fileName)
public XMLResultSetFactory(java.io.File file)
Method Detail |
---|
public MockResultSet create(java.lang.String id)
Document
.
create
in interface ResultSetFactory
public java.io.File getXMLFile()
File
being used to read in the
ResultSet
. Returns null
if
the file does not exist.
public void setTrim(boolean trim)
true
.
trim
- public boolean getTrim()
public void setDialect(int dialect)
Document
. Can be
different for different database systems.
Will determine the expected XML format for
the ResultSet
. SYBASE_DIALECT
is the only accepted dialect for now.
dialect
- int specifying which createXXXResultSet
method to call.public int getDialect()
Document
- Returns:
- dialect
public MockResultSet createSybaseResultSet(java.lang.String id)
Document
.
Document
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |