public enum IdentifierField extends java.lang.Enum<IdentifierField>
Lets getting or setting the case sensitivity of an identifier (column, table, schema, catalog or alias)
of an ADQLColumn or an ADQLTable.
The case sensitivity of an ADQL identifier is defined in a single attribute of type 'byte'. Each bit is designed to indicate the case sensitivity of a particular identifier part (from right to left):
Consequently to manage the case sensitivity of an identifier, you can use the following methods:
isCaseSensitive(byte): to know whether an identifier part is case sensitive or not in the given bytesetCaseSensitive(byte, boolean): to modify the given byte so that setting the case sensitivity of an identifier partExample: In ADQLColumn, the attribute 'caseSensitivity' lets managing the case sensitivity of all parts of the column identifier.
public class ADQLColumn implements ADQLOperand {
...
private byte caseSensitivity = 0;
...
public final boolean isCaseSensitive(IdentifierField field){
return field.isCaseSensitive(caseSensitivity);
}
public final void setCaseSensitive(IdentifierField field, boolean sensitive){
caseSensitivity = field.setCaseSensitive(caseSensitivity, sensitive);
}
...
}
ADQLColumn column = new ADQLColumn("myCat.mySchema.myTable.colName");
column.setCaseSensitive(IdentifierField.TABLE, true);
System.out.println("Is column name case sensitive ? "+column.isCaseSensitive(IdentifierField.COLUMN));
ADQLTable,
ADQLColumn| Enum Constant and Description |
|---|
ALIAS |
CATALOG |
COLUMN |
SCHEMA |
TABLE |
| Modifier and Type | Method and Description |
|---|---|
static byte |
getFullCaseSensitive(boolean sensitive)
Gets a byte in which all identifier parts are case sensitive or not.
|
boolean |
isCaseSensitive(byte caseSensitivity)
Tells whether this field is case sensitive in the given global case sensitivity definition.
|
static boolean |
isFullCaseSensitive(byte caseSensitivity)
Tells whether all identifier parts are case sensitive in the given global case sensitivity definition.
|
byte |
setCaseSensitive(byte caseSensitivity,
boolean sensitive)
Sets the case sensitivity of this identifier part in the given global case sensitivity definition.
|
static IdentifierField |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static IdentifierField[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IdentifierField COLUMN
public static final IdentifierField TABLE
public static final IdentifierField SCHEMA
public static final IdentifierField CATALOG
public static final IdentifierField ALIAS
public static IdentifierField[] values()
for (IdentifierField c : IdentifierField.values()) System.out.println(c);
public static IdentifierField valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic final boolean isCaseSensitive(byte caseSensitivity)
caseSensitivity - Definition of the case sensitivity of a whole ADQL identifier.public final byte setCaseSensitive(byte caseSensitivity,
boolean sensitive)
caseSensitivity - Definition of the case sensitivity of a whole ADQL identifier.sensitive - true for case sensitive, false otherwise.public static final boolean isFullCaseSensitive(byte caseSensitivity)
caseSensitivity - Definition of the case sensitivity of a whole ADQL identifier.public static final byte getFullCaseSensitive(boolean sensitive)
sensitive - true to set all identifier parts case sensitive, false otherwise.