public class UastHintsWorker.HintsReader
extends java.lang.Object
PatternEngine
worker.Constructor and Description |
---|
HintsReader() |
Modifier and Type | Method and Description |
---|---|
TableHints |
getExternalTableHints(java.lang.String table)
Retrieve the table hints, if any, for the specified table name from
a hints file not directly associated with the currently loaded AST.
|
TableHints |
getTableHints(java.lang.String table)
Retrieve the table hints, if any, for the specified table name.
|
java.lang.Boolean |
getUastBoolean(java.lang.String key)
Get a UAST hint using a uniquely named key, accessing a boolean or
null if no such hint exists. |
java.lang.Double |
getUastDouble(java.lang.String key)
Get a UAST hint using a uniquely named key, accessing a double or
null if no such hint exists. |
java.lang.String |
getUastHintType(java.lang.String key)
Accesses the class name (data type) of a UAST hint using a uniquely
named key.
|
java.lang.Long |
getUastLong(java.lang.String key)
Get a UAST hint using a uniquely named key, accessing a long or
null if no such hint exists. |
java.lang.String |
getUastString(java.lang.String key)
Get a UAST hint using a uniquely named key, accessing a string or
null if no such hint exists. |
java.lang.String |
getUastStringArray(java.lang.String key,
int index)
Get a UAST hint using a uniquely named key, accessing a string array
or
null if no such hint exists. |
boolean |
isFieldEscaped(java.lang.String table,
java.lang.String field)
Checks if field should be escaped.
|
boolean |
isSchemaEscaped()
Checks if hint is set for schema.
|
boolean |
isTableEscaped(java.lang.String table)
Checks if table should be escaped.
|
boolean |
isTableReadOnly(java.lang.String table)
Checks if table is read-only.
|
boolean |
isUastHint(java.lang.String key)
Checks the existence of a UAST hint using a uniquely named key.
|
private boolean |
loadHints()
Loads the hints file for an AST if it exists and hasn't already been
loaded.
|
public TableHints getTableHints(java.lang.String table)
table
- Name of the table for which hint information should be
retrieved.null
if none exists.public TableHints getExternalTableHints(java.lang.String table)
Note: unlike the other service methods of this worker, the hints loaded by this method are not cached, but are read each time this method is invoked.
table
- Name of the table for which hint information should be
retrieved. This name is a schema name which must be
qualified by the target database name for which to load
hints.null
if none exists.public java.lang.String getUastString(java.lang.String key)
null
if no such hint exists.key
- Unique name for the hint, which is used as a key.null
.public java.lang.String getUastStringArray(java.lang.String key, int index)
null
if no such hint exists.key
- Unique name for the hint, which is used as a key.index
- The 0-based index of the entry to access.null
if the array or element doesn't exist.public java.lang.Long getUastLong(java.lang.String key)
null
if no such hint exists.key
- Unique name for the hint, which is used as a key.null
.public java.lang.Double getUastDouble(java.lang.String key)
null
if no such hint exists.key
- Unique name for the hint, which is used as a key.null
.public java.lang.Boolean getUastBoolean(java.lang.String key)
null
if no such hint exists.key
- Unique name for the hint, which is used as a key.null
.public java.lang.String getUastHintType(java.lang.String key)
key
- Unique name for the hint, which is used as a key.null
if the hint does not exist.public boolean isUastHint(java.lang.String key)
key
- Unique name for the hint, which is used as a key.true
if any hint exists by that key for this
file, false
if no such hint exists.public boolean isSchemaEscaped()
true
if "escape" hint is set for schema and equals
true
, otherwise false
.public boolean isFieldEscaped(java.lang.String table, java.lang.String field)
table
- The legacy table name.field
- The legacy field name.public boolean isTableEscaped(java.lang.String table)
table
- The legacy table name.public boolean isTableReadOnly(java.lang.String table)
table
- The legacy table name.false
private boolean loadHints()
true
if there are hints for this file and the
hints are loaded, false
if no hints are
available.