public abstract class MetaNameFixer extends Object
Concrete instances must implement the abstract
getFixedTableName(java.lang.String, uk.ac.starlink.vo.SchemaMeta)
and getFixedColumnName(java.lang.String)
methods.
The fix*
methods can then be used to fix up table
metadata acquired from some service for use within ADQL queries.
The getOriginal*Name
methods may be required for
subsequent communications with the service (since the original
names are the ones that the service knows about).
Modifier and Type | Field and Description |
---|---|
static MetaNameFixer |
NONE
Instance which makes no name changes.
|
Modifier | Constructor and Description |
---|---|
protected |
MetaNameFixer()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static MetaNameFixer |
createAdqlFixer(AdqlSyntax syntax)
Returns a new instance that follows rules for a particular ADQL-like
syntax.
|
static MetaNameFixer |
createDefaultFixer()
Returns a new instance that follows standard ADQL syntax rules.
|
void |
fixColumns(ColumnMeta[] columns)
Ensures that the given columns
have syntactically acceptable names.
|
void |
fixSchemas(SchemaMeta[] schemas)
Ensures that the given schemas and their contained tables and columns
have syntactically acceptable names.
|
void |
fixTables(TableMeta[] tables,
SchemaMeta schema)
Ensures that the given tables and their contained columns
have syntactically acceptable names.
|
abstract String |
getFixedColumnName(String cname)
Returns a column name which is syntactically acceptable.
|
abstract String |
getFixedTableName(String tname,
SchemaMeta schema)
Returns a table name which is syntactically acceptable.
|
String |
getOriginalColumnName(ColumnMeta column)
Returns the unfixed name for a given column.
|
String |
getOriginalTableName(TableMeta table)
Returns the unfixed name for a given table.
|
public static MetaNameFixer NONE
public abstract String getFixedTableName(String tname, SchemaMeta schema)
tname
- original table nameschema
- schema from which table was acquiredpublic abstract String getFixedColumnName(String cname)
cname
- original column namepublic void fixSchemas(SchemaMeta[] schemas)
schemas
- schemas to fix uppublic void fixTables(TableMeta[] tables, SchemaMeta schema)
tables
- tables to fix upschema
- schema containing the given tablespublic void fixColumns(ColumnMeta[] columns)
columns
- columns to fix uppublic String getOriginalColumnName(ColumnMeta column)
column
- column whose name may have been fixedpublic String getOriginalTableName(TableMeta table)
table
- table whose name may have been fixedpublic static MetaNameFixer createDefaultFixer()
public static MetaNameFixer createAdqlFixer(AdqlSyntax syntax)
syntax
- syntax rulesCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.