|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ddlutils.io.DatabaseIO
This class provides functions to read and write database models from/to XML.
| Constructor Summary | |
DatabaseIO()
|
|
| Method Summary | |
protected BeanReader |
getReader()
Returns a new bean reader configured to read database models. |
protected BeanWriter |
getWriter(Writer output)
Returns a new bean writer configured to writer database models. |
boolean |
isUseInternalDtd()
Returns whether the internal dtd that comes with DdlUtils is used. |
boolean |
isValidateXml()
Returns whether XML is validated upon reading it. |
Database |
read(File file)
Reads the database model contained in the specified file. |
Database |
read(Reader reader)
Reads the database model given by the reader. |
Database |
read(String filename)
Reads the database model contained in the specified file. |
void |
setUseInternalDtd(boolean useInternalDtd)
Specifies whether the internal dtd is to be used. |
void |
setValidateXml(boolean validateXml)
Specifies whether XML shall be validated upon reading it. |
void |
write(Database model,
OutputStream output)
Writes the database model to the given output stream. |
void |
write(Database model,
String filename)
Writes the database model to the specified file. |
void |
write(Database model,
Writer output)
Writes the database model to the given output writer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DatabaseIO()
| Method Detail |
public boolean isValidateXml()
true if read XML is validatedpublic void setValidateXml(boolean validateXml)
validateXml - true if read XML shall be validatedpublic boolean isUseInternalDtd()
true if parsing uses the internal dtdpublic void setUseInternalDtd(boolean useInternalDtd)
useInternalDtd - Whether to use the internal dtd
protected BeanReader getReader()
throws IntrospectionException,
SAXException,
IOException
IntrospectionException
SAXException
IOException
protected BeanWriter getWriter(Writer output)
throws IntrospectionException,
SAXException,
IOException
output - The target output writer
IntrospectionException
SAXException
IOException
public Database read(String filename)
throws DdlUtilsException
filename - The model file name
DdlUtilsException
public Database read(File file)
throws DdlUtilsException
file - The model file
DdlUtilsException
public Database read(Reader reader)
throws DdlUtilsException
reader - The reader that returns the model XML
DdlUtilsException
public void write(Database model,
String filename)
throws DdlUtilsException
model - The database modelfilename - The model file name
DdlUtilsException
public void write(Database model,
OutputStream output)
throws DdlUtilsException
model - The database modeloutput - The output stream
DdlUtilsException
public void write(Database model,
Writer output)
throws DdlUtilsException
model - The database modeloutput - The output writer
DdlUtilsException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||