uk.org.ogsadai.converters.databaseschema.fromxml
Class TableMetaDataImpl

java.lang.Object
  |
  +--uk.org.ogsadai.converters.databaseschema.fromxml.TableMetaDataImpl
All Implemented Interfaces:
TableMetaData

public class TableMetaDataImpl
extends java.lang.Object
implements TableMetaData

An implementation of TableMetaData which extracts relational table information from a org.w3c.dom.Element.

Author:
The OGSA-DAI Team.
See Also:
TableMetaData

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  java.lang.String mCatalog
           
private  java.util.Map mColumnMap
           
private  ColumnMetaData[] mColumns
           
private  KeyMetaData[] mExportedKeys
           
private  KeyMetaData[] mImportedKeys
           
private  java.lang.String mName
           
private  java.util.Set mPrimaryKeys
           
private  java.lang.String mSchema
           
 
Constructor Summary
TableMetaDataImpl(org.w3c.dom.Element table)
          Create from information in given XML fragment.
 
Method Summary
 java.lang.String getCatalogName()
          Returns the catalog name of this table.
 ColumnMetaData getColumn(int index)
          Returns the type information of the column at the specified index.
 int getColumnCount()
          Returns the number of columns in this table.
 KeyMetaData[] getExportedKeys()
          Returns the exported keys of this table.
 KeyMetaData[] getImportedKeys()
          Returns the imported keys of this table.
 java.lang.String getName()
          Returns the name of this table.
 java.lang.String[] getPrimaryKeys()
          Returns a set of columns which form the (composite) primary key of this table.
 java.lang.String getSchemaName()
          Returns the schema name of this table.
private  KeyMetaData[] parseKeys(org.w3c.dom.Element schema, java.lang.String elementName)
          Parses the imported or exported keys of a database table.
 
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

mName

private java.lang.String mName

mSchema

private java.lang.String mSchema

mCatalog

private java.lang.String mCatalog

mColumns

private ColumnMetaData[] mColumns

mPrimaryKeys

private java.util.Set mPrimaryKeys

mImportedKeys

private KeyMetaData[] mImportedKeys

mExportedKeys

private KeyMetaData[] mExportedKeys

mColumnMap

private java.util.Map mColumnMap
Constructor Detail

TableMetaDataImpl

public TableMetaDataImpl(org.w3c.dom.Element table)
Create from information in given XML fragment.

Parameters:
table - XML fragment.
Method Detail

parseKeys

private KeyMetaData[] parseKeys(org.w3c.dom.Element schema,
                                java.lang.String elementName)
Parses the imported or exported keys of a database table.

Parameters:
schema - The XML element representing the database schema.
elementName - The name of the element to retrieve i.e. importedKeys or exportedKeys.
Returns:
array of attributes for each key.

getName

public java.lang.String getName()
Description copied from interface: TableMetaData
Returns the name of this table.

Specified by:
getName in interface TableMetaData
Returns:
name.

getSchemaName

public java.lang.String getSchemaName()
Description copied from interface: TableMetaData
Returns the schema name of this table.

Specified by:
getSchemaName in interface TableMetaData
Returns:
schema name.

getCatalogName

public java.lang.String getCatalogName()
Description copied from interface: TableMetaData
Returns the catalog name of this table.

Specified by:
getCatalogName in interface TableMetaData
Returns:
catalog name.

getColumnCount

public int getColumnCount()
Description copied from interface: TableMetaData
Returns the number of columns in this table.

Specified by:
getColumnCount in interface TableMetaData
Returns:
number of columns.

getColumn

public ColumnMetaData getColumn(int index)
Description copied from interface: TableMetaData
Returns the type information of the column at the specified index.

Specified by:
getColumn in interface TableMetaData
Parameters:
index - The column index.
Returns:
column type information.

getPrimaryKeys

public java.lang.String[] getPrimaryKeys()
Description copied from interface: TableMetaData
Returns a set of columns which form the (composite) primary key of this table.

Specified by:
getPrimaryKeys in interface TableMetaData
Returns:
set of column names

getImportedKeys

public KeyMetaData[] getImportedKeys()
Description copied from interface: TableMetaData
Returns the imported keys of this table.

Specified by:
getImportedKeys in interface TableMetaData
Returns:
imported keys.

getExportedKeys

public KeyMetaData[] getExportedKeys()
Description copied from interface: TableMetaData
Returns the exported keys of this table.

Specified by:
getExportedKeys in interface TableMetaData
Returns:
imported keys.