public abstract class MetaNameFixer
extends java.lang.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 | Description |
---|---|---|
static MetaNameFixer |
NONE |
Instance which makes no name changes.
|
Modifier | Constructor | Description |
---|---|---|
protected |
MetaNameFixer() |
Constructor.
|
Modifier and Type | Method | 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 java.lang.String |
getFixedColumnName(java.lang.String cname) |
Returns a column name which is syntactically acceptable.
|
abstract java.lang.String |
getFixedTableName(java.lang.String tname,
SchemaMeta schema) |
Returns a table name which is syntactically acceptable.
|
java.lang.String |
getOriginalColumnName(ColumnMeta column) |
Returns the unfixed name for a given column.
|
java.lang.String |
getOriginalTableName(TableMeta table) |
Returns the unfixed name for a given table.
|
public static MetaNameFixer NONE
public abstract java.lang.String getFixedTableName(java.lang.String tname, SchemaMeta schema)
tname
- original table nameschema
- schema from which table was acquiredpublic abstract java.lang.String getFixedColumnName(java.lang.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 java.lang.String getOriginalColumnName(ColumnMeta column)
column
- column whose name may have been fixedpublic java.lang.String getOriginalTableName(TableMeta table)
table
- table whose name may have been fixedpublic static MetaNameFixer createDefaultFixer()
public static MetaNameFixer createAdqlFixer(AdqlSyntax syntax)
syntax
- syntax rulesCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.