public class DatabaseIO extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BASE64_ATTR_NAME
The name of the XML attribute use to denote that teh content of a data XML
element uses Base64 encoding.
|
| Constructor and Description |
|---|
DatabaseIO() |
| Modifier and Type | Method and Description |
|---|---|
protected InputSource |
getBetwixtMapping()
Returns the commons-betwixt mapping file as an
InputSource object. |
protected org.apache.commons.betwixt.io.BeanReader |
getReader()
Returns a new bean reader configured to read database models.
|
protected org.apache.commons.betwixt.io.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(InputSource source)
Reads the database model from the given input source.
|
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.
|
public static final String BASE64_ATTR_NAME
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 dtdprotected InputSource getBetwixtMapping()
InputSource object.
Per default, this will be classpath resource under the path /mapping.xml.protected org.apache.commons.betwixt.io.BeanReader getReader()
throws IntrospectionException,
SAXException,
IOException
IntrospectionExceptionSAXExceptionIOExceptionprotected org.apache.commons.betwixt.io.BeanWriter getWriter(Writer output) throws DdlUtilsException
output - The target output writerDdlUtilsExceptionpublic Database read(String filename) throws DdlUtilsException
filename - The model file nameDdlUtilsExceptionpublic Database read(File file) throws DdlUtilsException
file - The model fileDdlUtilsExceptionpublic Database read(Reader reader) throws DdlUtilsException
reader - The reader that returns the model XMLDdlUtilsExceptionpublic Database read(InputSource source) throws DdlUtilsException
source - The input sourceDdlUtilsExceptionpublic void write(Database model, String filename) throws DdlUtilsException
model - The database modelfilename - The model file nameDdlUtilsExceptionpublic void write(Database model, OutputStream output) throws DdlUtilsException
model - The database modeloutput - The output streamDdlUtilsExceptionpublic void write(Database model, Writer output) throws DdlUtilsException
model - The database modeloutput - The output writerDdlUtilsExceptionCopyright © 2005-2013 Apache Software Foundation. All Rights Reserved.