Package adams.db
Class MetaDataUtils
- java.lang.Object
-
- adams.db.MetaDataUtils
-
public class MetaDataUtils extends Object
Utility class for database meta-data.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String[]JDBC_VALUESprotected static LoggerLOGGERfor logging.
-
Constructor Summary
Constructors Constructor Description MetaDataUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddRow(SpreadSheet sheet, String key, Object value)Adds a row to the sheet with the given key and value.protected static voidaddRow(DatabaseMetaData metadata, SpreadSheet sheet, String key)Adds a row to the sheet with the given key.static SpreadSheetgetMetaData(AbstractDatabaseConnection conn, AbstractTypeMapper mapper, MetaDataType type, String table, MessageCollection errors)Generates spreadsheet with the metadata.static MetaDataType[]typesRequireTable()Returns the metadata types that require a table.
-
-
-
Method Detail
-
addRow
protected static void addRow(SpreadSheet sheet, String key, Object value)
Adds a row to the sheet with the given key and value.- Parameters:
sheet- the sheet to add the value tokey- the key of the valuevalue- the value to add
-
addRow
protected static void addRow(DatabaseMetaData metadata, SpreadSheet sheet, String key)
Adds a row to the sheet with the given key. Obtains the value using the associated method name in the meta-data- Parameters:
metadata- the meta-data to usesheet- the sheet to add the value tokey- the key of the value
-
typesRequireTable
public static MetaDataType[] typesRequireTable()
Returns the metadata types that require a table.- Returns:
- the types
-
getMetaData
public static SpreadSheet getMetaData(AbstractDatabaseConnection conn, AbstractTypeMapper mapper, MetaDataType type, String table, MessageCollection errors)
Generates spreadsheet with the metadata.- Parameters:
conn- the database connection to usemapper- the mapper for typestype- the type of metadata to returntable- the table to use (only some metadata types, see @see)errors- for collecting error messages- Returns:
- the metadata, null if failed to generate
- See Also:
typesRequireTable()
-
-