uk.org.ogsadai.converters.databaseschema.toxml
Class SchemaToXMLConverter

java.lang.Object
  |
  +--uk.org.ogsadai.converters.databaseschema.toxml.SchemaToXMLConverter
All Implemented Interfaces:
SchemaConverter

public class SchemaToXMLConverter
extends java.lang.Object
implements SchemaConverter

A schema converter that writes an XML document describing a database schema.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
 
Constructor Summary
SchemaToXMLConverter()
           
 
Method Summary
private  void addColumns(TableMetaData table, java.lang.StringBuffer schema)
          Writes a column description to a buffer.
private  void addExportedKeys(KeyMetaData[] keys, java.lang.StringBuffer schema)
          Writes the exported keys information to a buffer.
private  void addImportedKeys(KeyMetaData[] keys, java.lang.StringBuffer schema)
          Write the imported keys information to a buffer.
private  void addPrimaryKeys(java.lang.String[] keys, java.lang.StringBuffer output)
          Writes the primary keys information to a buffer.
 void writeFooter(java.lang.StringBuffer footer)
          Write the footer information for the database schema.
 void writeHeader(java.lang.StringBuffer header)
          Write the header information for the database schema.
 void writeProcedures(java.lang.StringBuffer output, StoredProcedureMetaData procedures)
          Convert the stored procedures meta data into a string.
 void writeTable(java.lang.StringBuffer schema, TableMetaData table)
          Convert the table meta data into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values
Constructor Detail

SchemaToXMLConverter

public SchemaToXMLConverter()
Method Detail

writeHeader

public void writeHeader(java.lang.StringBuffer header)
Description copied from interface: SchemaConverter
Write the header information for the database schema.

Specified by:
writeHeader in interface SchemaConverter
Parameters:
header - A header.

writeFooter

public void writeFooter(java.lang.StringBuffer footer)
Description copied from interface: SchemaConverter
Write the footer information for the database schema.

Specified by:
writeFooter in interface SchemaConverter
Parameters:
footer - A footer.

writeTable

public void writeTable(java.lang.StringBuffer schema,
                       TableMetaData table)
Description copied from interface: SchemaConverter
Convert the table meta data into a string.

Specified by:
writeTable in interface SchemaConverter
Parameters:
schema - Destination for table meta data.
table - Table meta data.

writeProcedures

public void writeProcedures(java.lang.StringBuffer output,
                            StoredProcedureMetaData procedures)
Description copied from interface: SchemaConverter
Convert the stored procedures meta data into a string.

Specified by:
writeProcedures in interface SchemaConverter
Parameters:
output - Destination for stored procedures meta data.
procedures - Stored procedures meta data.

addColumns

private void addColumns(TableMetaData table,
                        java.lang.StringBuffer schema)
Writes a column description to a buffer.

Parameters:
table - Table meta data.
schema - Output buffer to write to.

addPrimaryKeys

private void addPrimaryKeys(java.lang.String[] keys,
                            java.lang.StringBuffer output)
Writes the primary keys information to a buffer.

Parameters:
keys - Names of the primary keys in this table.
output - Output buffer to write to.

addImportedKeys

private void addImportedKeys(KeyMetaData[] keys,
                             java.lang.StringBuffer schema)
Write the imported keys information to a buffer.

Parameters:
keys - Imported keys of this table.
schema - Output buffer to write to.

addExportedKeys

private void addExportedKeys(KeyMetaData[] keys,
                             java.lang.StringBuffer schema)
Writes the exported keys information to a buffer.

Parameters:
keys - Exported keys of this table.
schema - Output buffer to write to.