public class DBIdentifier extends IdentifierImpl implements Cloneable, Identifier, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
DBIdentifier.DBIdentifierType
Database identifier types.
|
Modifier and Type | Field and Description |
---|---|
boolean |
_ignoreCase |
static DBIdentifier |
NULL
Special NULL indicator for db identifiers.
|
Modifier | Constructor and Description |
---|---|
protected |
DBIdentifier() |
protected |
DBIdentifier(String name,
boolean delimit) |
protected |
DBIdentifier(String name,
DBIdentifier.DBIdentifierType type) |
protected |
DBIdentifier(String name,
DBIdentifier.DBIdentifierType type,
boolean delimit) |
Modifier and Type | Method and Description |
---|---|
static DBIdentifier |
append(DBIdentifier name,
String str)
Returns a new DBIdentifier with the given string appended.
|
DBIdentifier |
clone()
Clones an identifier using deep copy.
|
static DBIdentifier |
combine(DBIdentifier.DBIdentifierType id,
String... names)
Combines an array of names names using standard combining rules and
returns an identifier of the specified type.
|
static DBIdentifier |
combine(DBIdentifier name,
String str)
Returns a new DBIdentifier with the given string combined using
delimiting rules and appropriate separators.
|
int |
compareTo(Identifier o)
Comparison operator for identifiers.
|
static boolean |
equal(DBIdentifier name1,
DBIdentifier name2)
Static equality method for comparing two identifiers.
|
boolean |
equals(Object obj)
Equality operation for identifiers.
|
boolean |
equalsIgnoreCase(DBIdentifier name)
Equality operator which ignores case.
|
static boolean |
equalsIgnoreCase(DBIdentifier name1,
DBIdentifier name2)
Static equality operator which ignores case.
|
boolean |
getIgnoreCase()
Returns whether case is ignored during equality operations.
|
DBIdentifier.DBIdentifierType |
getType()
Get the identifier type
|
DBIdentifier |
getUnqualifiedName()
Returns the unqualified name of this identifier.
|
boolean |
isDelimited()
Returns true if the identifier is delimited.
|
static boolean |
isEmpty(DBIdentifier name)
Returns true if the identifier is null or the name is null or empty.
|
boolean |
isNull()
Returns true if this object is NULL or has a null name component.
|
static boolean |
isNull(DBIdentifier name)
Returns true if the identifier is null.
|
static String |
join(DBIdentifier... names)
Joins the list of identifiers using the appropriate delimiters and
returns a string based identifier.
|
int |
length()
The length of the name, including delimiting characters.
|
static DBIdentifier |
newCatalog(String name)
Constructs a new identifier of type Catalog.
|
static DBIdentifier |
newCatalog(String name,
boolean delimit)
Constructs a new identifier of type Catalog ,optionally delimiting
the name.
|
static DBIdentifier |
newColumn(String name)
Constructs a new identifier of type Column.
|
static DBIdentifier |
newColumn(String name,
boolean delimit)
Constructs a new identifier of type Column,optionally delimiting
the name.
|
static DBIdentifier |
newColumnDefinition(String name)
Constructs a new identifier of type Column Definition.
|
static DBIdentifier |
newConstant(String name)
Constructs a new identifier of type Constant.
|
static DBIdentifier |
newConstraint(String name)
Constructs a new identifier of type Constraint.
|
static DBIdentifier |
newConstraint(String name,
boolean delimit)
Constructs a new identifier of type Constraint, optionally delimiting
the name.
|
static DBIdentifier |
newDefault(String name)
Constructs a new identifier of type Default.
|
static DBIdentifier |
newForeignKey(String name)
Constructs a new identifier of type ForeignKey.
|
static DBIdentifier |
newForeignKey(String name,
boolean delimit)
Constructs a new identifier of type ForeignKey, optionally delimiting
the name.
|
protected static DBIdentifier |
newIdentifier(String name,
DBIdentifier.DBIdentifierType id)
Constructs a new identifier with the provided name and type
|
static DBIdentifier |
newIdentifier(String name,
DBIdentifier.DBIdentifierType id,
boolean toUpper)
Constructs a new identifier with the provided name an type.
|
protected static DBIdentifier |
newIdentifier(String name,
DBIdentifier.DBIdentifierType id,
boolean toUpper,
boolean delimit)
Constructs a new identifier (potentially a compound QualifiedDBIdentifier) with the provided
name an type.
|
protected static DBIdentifier |
newIdentifier(String name,
DBIdentifier.DBIdentifierType id,
boolean toUpper,
boolean delimit,
boolean ignoreCase)
Constructs a new identifier (potentially a compound QualifiedDBIdentifier) with the provided
name an type.
|
static DBIdentifier |
newIndex(String name)
Constructs a new identifier of type Index.
|
static DBIdentifier |
newIndex(String name,
boolean delimit)
Constructs a new identifier of type Index, optionally delimiting
the name.
|
static DBIdentifier |
newSchema(String name)
Constructs a new identifier of type Schema.
|
static DBIdentifier |
newSchema(String name,
boolean delimit)
Constructs a new identifier of type Schema, optionally delimiting
the name.
|
static DBIdentifier |
newSequence(String name)
Constructs a new identifier of type Sequence.
|
static DBIdentifier |
newSequence(String name,
boolean delimit)
Constructs a new identifier of type Sequence, optionally delimiting
the name.
|
static DBIdentifier |
newTable(String name)
Constructs a new identifier of type Table.
|
static DBIdentifier |
newTable(String name,
boolean delimit)
Constructs a new identifier of type Table, optionally delimiting
the name.
|
static DBIdentifier |
preCombine(DBIdentifier name,
String prefix)
Returns a new identifier with a combined prefix and name using the standard name
concatenation character ('_').
|
static DBIdentifier |
removeDelimiters(DBIdentifier name)
Returns a new identifier with delimiters removed.
|
static DBIdentifier |
removeHungarianNotation(DBIdentifier name)
Returns a new DBIdentifier with Hungarian notation removed.
|
static DBIdentifier |
removeLeading(DBIdentifier name,
String leadingStr)
Returns a new DBIdentifier with the specified leading string removed.
|
void |
setIgnoreCase(boolean ignoreCase) |
void |
setName(DBIdentifier name)
Set the name of this identifier based upon a given identifier.
|
void |
setName(String name)
Set the name of the identifier.
|
void |
setName(String name,
boolean delimit)
Set the name of the identifier and optionally force delimiting of the identifier.
|
protected void |
setType(DBIdentifier.DBIdentifierType type)
Set the type of the identifier
|
static DBIdentifier[] |
split(DBIdentifier.DBIdentifierType resultType,
String name)
Splits a given DBIdentifier into multiple DBIdentifiers.
|
static DBIdentifier[] |
split(String name,
DBIdentifier.DBIdentifierType id,
String delim)
Splits a string delimited by the specified delimiter of a given name type
into an array of DBIdentifier objects.
|
static DBIdentifier[] |
toArray(String[] columnNames,
DBIdentifier.DBIdentifierType id)
Converts the provided set of names to an array of identifiers of the
provided type
|
static DBIdentifier[] |
toArray(String[] names,
DBIdentifier.DBIdentifierType id,
boolean delimit)
Converts the provided set of names to an array of identifiers of the
provided type, optionally delimiting the names.
|
static DBIdentifier |
toLower(DBIdentifier name)
Returns a new DBIdentifier converted to lower case - if not delimited.
|
static DBIdentifier |
toLower(DBIdentifier name,
boolean force)
Returns a new DBIdentifier converted to lower case.
|
static String[] |
toStringArray(DBIdentifier[] sNames)
Returns a string array of names based upon the provided set of identifiers.
|
static DBIdentifier |
toUpper(DBIdentifier name)
Returns a new DBIdentifier converted to upper case - if not delimited.
|
static DBIdentifier |
toUpper(DBIdentifier name,
boolean force)
Returns a new DBIdentifier converted to upper case.
|
static DBIdentifier |
trim(DBIdentifier name)
Returns a new delimiter with leading and trailing spaces removed.
|
static DBIdentifier |
trimToNull(DBIdentifier name)
Returns a copy of an identifier with name trimmed to null.
|
static DBIdentifier |
truncate(DBIdentifier name,
int length)
Returns a new DBIdentifier truncated to length
|
getName, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getName
public static final DBIdentifier NULL
public boolean _ignoreCase
protected DBIdentifier()
protected DBIdentifier(String name, DBIdentifier.DBIdentifierType type)
protected DBIdentifier(String name, DBIdentifier.DBIdentifierType type, boolean delimit)
protected DBIdentifier(String name, boolean delimit)
public boolean getIgnoreCase()
public void setIgnoreCase(boolean ignoreCase)
public void setName(String name)
setName
in interface Identifier
setName
in class IdentifierImpl
public void setName(DBIdentifier name)
public void setName(String name, boolean delimit)
protected void setType(DBIdentifier.DBIdentifierType type)
type
- public DBIdentifier.DBIdentifierType getType()
public static DBIdentifier[] split(String name, DBIdentifier.DBIdentifierType id, String delim)
name
- id
- delim
- public static String join(DBIdentifier... names)
resultId
- names
- public static DBIdentifier[] split(DBIdentifier.DBIdentifierType resultType, String name)
name
- public static boolean isEmpty(DBIdentifier name)
name
- public static boolean isNull(DBIdentifier name)
name
- public DBIdentifier clone()
public static DBIdentifier trimToNull(DBIdentifier name)
name
- public boolean equals(Object obj)
public boolean isNull()
public int compareTo(Identifier o)
compareTo
in interface Comparable<Identifier>
compareTo
in class IdentifierImpl
public static DBIdentifier[] toArray(String[] columnNames, DBIdentifier.DBIdentifierType id)
columnNames
- id
- public static DBIdentifier[] toArray(String[] names, DBIdentifier.DBIdentifierType id, boolean delimit)
columnNames
- id
- public static String[] toStringArray(DBIdentifier[] sNames)
sNames
- public static DBIdentifier newCatalog(String name)
public static DBIdentifier newCatalog(String name, boolean delimit)
public static DBIdentifier newTable(String name)
public static DBIdentifier newTable(String name, boolean delimit)
public static DBIdentifier newColumn(String name)
public static DBIdentifier newColumn(String name, boolean delimit)
public static DBIdentifier newSchema(String name)
public static DBIdentifier newSchema(String name, boolean delimit)
public static DBIdentifier newIndex(String name)
public static DBIdentifier newIndex(String name, boolean delimit)
public static DBIdentifier newSequence(String name)
public static DBIdentifier newSequence(String name, boolean delimit)
public static DBIdentifier newForeignKey(String name)
public static DBIdentifier newForeignKey(String name, boolean delimit)
public static DBIdentifier newConstraint(String name)
public static DBIdentifier newConstraint(String name, boolean delimit)
public static DBIdentifier newConstant(String name)
public static DBIdentifier newColumnDefinition(String name)
public static DBIdentifier newDefault(String name)
protected static DBIdentifier newIdentifier(String name, DBIdentifier.DBIdentifierType id)
public static DBIdentifier newIdentifier(String name, DBIdentifier.DBIdentifierType id, boolean toUpper)
protected static DBIdentifier newIdentifier(String name, DBIdentifier.DBIdentifierType id, boolean toUpper, boolean delimit)
protected static DBIdentifier newIdentifier(String name, DBIdentifier.DBIdentifierType id, boolean toUpper, boolean delimit, boolean ignoreCase)
public static boolean equal(DBIdentifier name1, DBIdentifier name2)
name1
- name2
- public static DBIdentifier truncate(DBIdentifier name, int length)
name
- length
- public static DBIdentifier append(DBIdentifier name, String str)
name
- length
- public static DBIdentifier combine(DBIdentifier name, String str)
name
- length
- public static DBIdentifier toLower(DBIdentifier name)
name
- public static DBIdentifier toLower(DBIdentifier name, boolean force)
name
- public static DBIdentifier toUpper(DBIdentifier name)
name
- public static DBIdentifier toUpper(DBIdentifier name, boolean force)
name
- public static DBIdentifier removeLeading(DBIdentifier name, String leadingStr)
name
- public static DBIdentifier removeHungarianNotation(DBIdentifier name)
name
- public boolean equalsIgnoreCase(DBIdentifier name)
name
- public static boolean equalsIgnoreCase(DBIdentifier name1, DBIdentifier name2)
name
- public static DBIdentifier preCombine(DBIdentifier name, String prefix)
prefix
- public static DBIdentifier removeDelimiters(DBIdentifier name)
name
- public static DBIdentifier trim(DBIdentifier name)
name
- public int length()
length
in interface Identifier
length
in class IdentifierImpl
public boolean isDelimited()
public static DBIdentifier combine(DBIdentifier.DBIdentifierType id, String... names)
public DBIdentifier getUnqualifiedName()
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.