Interface IdentifierUtil
- All Known Subinterfaces:
DBIdentifierUtil
- All Known Implementing Classes:
DBIdentifierUtilImpl
,IdentifierUtilImpl
public interface IdentifierUtil
Base IdentifierUtil interface. Defines many operations for operating
on strings using identifier rules.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendNames
(String rule, String name1, String name2) Append the names together while maintaining delimiters.appendNames
(IdentifierRule rule, String name1, String name2) Append the names together while maintaining delimiters.boolean
Determines whether a name can be split into multiple components.boolean
Determines whether a name can be split into multiple components, taking into account the specified delimiter.boolean
canSplit
(IdentifierRule rule, String name) Determines whether a name can be split into multiple components.boolean
canSplit
(IdentifierRule rule, String name, String delim) Determines whether a name can be split into multiple components, taking into account the specified delimiter.combineNames
(String rule, String[] names) Combines names using the specified delimiting rule and appropriate separatorscombineNames
(String rule, String[] rules, String[] names) Combines names using delimiting rules and appropriate separatorscombineNames
(String rule, String name1, String name2) Combines two names using delimiting rules and appropriate separatorscombineNames
(IdentifierRule rule, String[] names) Combines names using the specified delimiting rule and appropriate separatorscombineNames
(IdentifierRule rule, String name1, String name2) Combines two names using delimiting rules and appropriate separatorscombineNames
(IdentifierRule rule, IdentifierRule[] rules, String[] names) Combines names using delimiting rules and appropriate separatorsconvert
(IdentifierConfiguration config, String rule, String name) Convert the string using this naming configuration to the supplied naming configuration.convertFull
(IdentifierConfiguration config, String rule, String fullName) Converts a qualified string-based name defined using the base configuration to the specified configuration.Delimit the name if it requires delimitersDelimit the string with the option to force delimiting.delimit
(IdentifierRule rule, String name) Delimit the name if it requires delimitersdelimit
(IdentifierRule rule, String name, boolean force) Delimit the string with the option to force delimiting.Get the naming configuration.boolean
isDelimited
(String rule, String name) Determines whether a name is delimited.boolean
isDelimited
(IdentifierRule rule, String name) Determines whether a name is delimited.boolean
isReservedWord
(String rule, String name) Returns whether a name is considered a reserved wordboolean
isReservedWord
(IdentifierRule rule, String name) Returns whether a name is considered a reserved wordJoins several names with different naming rules into a single string using appropriate delimiters and separatorsJoins several names with different naming rules into a single string using appropriate delimiters and separatorsJoins several names with different naming rules into a single string using the specified delimiterjoinNames
(IdentifierRule[] rules, String[] names) Joins several names with different naming rules into a single string using appropriate delimiters and separatorsjoinNames
(IdentifierRule rule, String[] names) Joins several names with different naming rules into a single string using appropriate delimiters and separatorsjoinNames
(IdentifierRule rule, String[] names, String delimiter) Joins several names with different naming rules into a single string using the specified delimiterremoveDelimiters
(String rule, String name) Remove delimiters from a delimited nameremoveDelimiters
(IdentifierConfiguration config, String rule, String name) Remove delimiters from a delimited nameremoveDelimiters
(IdentifierRule rule, String name) Remove delimiters from a delimited nameremoveHungarianNotation
(String rule, String name) Removes Hungarian notation from the specified string.removeHungarianNotation
(IdentifierRule rule, String name) Removes Hungarian notation from the specified string.boolean
requiresDelimiters
(String rule, String name) Determines whether a name requires delimiters based upon: The SQL-92 Reference definition of a valid unquoted name The naming rule specifiedboolean
requiresDelimiters
(IdentifierRule rule, String name) Determines whether a name requires delimiters based upon: The SQL-92 Reference definition of a valid unquoted name The naming rule specifiedvoid
Set the naming configuration to use for naming operations.String[]
Splits a combined name name using the provided naming ruleString[]
Splits a combined name name using the provided naming rule and delimiter.String[]
splitName
(IdentifierRule rule, String name) Splits a combined name name using the provided naming ruleString[]
splitName
(IdentifierRule rule, String name, String delimiter) Splits a combined name name using the provided naming rule and delimiter.truncateName
(String rule, String name, int length) Truncates a name while maintaining delimiters.truncateName
(IdentifierRule rule, String name, int length) Truncates a name while maintaining delimiters.
-
Field Details
-
DOUBLE_QUOTE
- See Also:
-
DOT
- See Also:
-
UNDERSCORE
- See Also:
-
SPACE
- See Also:
-
BAR
- See Also:
-
EMPTY
- See Also:
-
PERCENT
- See Also:
-
DOLLAR_CHAR
static final char DOLLAR_CHAR- See Also:
-
UNDERSCORE_CHAR
static final char UNDERSCORE_CHAR- See Also:
-
CASE_UPPER
- See Also:
-
CASE_LOWER
- See Also:
-
CASE_PRESERVE
- See Also:
-
-
Method Details
-
getIdentifierConfiguration
IdentifierConfiguration getIdentifierConfiguration()Get the naming configuration. -
setIdentifierConfiguration
Set the naming configuration to use for naming operations. A naming configuration must be set before calling any other methods. -
delimit
Delimit the name if it requires delimiters- Parameters:
rule
- the rule to use for delimitingname
- the name to delimit- Returns:
- the delimited name, if delimiting was necessary.
-
delimit
Delimit the name if it requires delimiters- Parameters:
rule
- the rule to use for delimitingname
- the name to delimit- Returns:
- the delimited name, if delimiting was necessary.
-
delimit
Delimit the string with the option to force delimiting. If force is true, the name will delimited without checking to see if it requires delimiters.- Parameters:
rule
- the rule to use for delimitingname
- the name to delimitforce
- add delimiters even if delimiting is not required- Returns:
- the delimited name, if delimiting was necessary.
-
delimit
Delimit the string with the option to force delimiting. If force is true, the name will delimited without checking to see if it requires delimiters.- Parameters:
rule
- the rule to use for delimitingname
- the name to delimitforce
- add delimiters even if delimiting is not required- Returns:
- the delimited name, if delimiting was necessary.
-
removeDelimiters
Remove delimiters from a delimited name- Parameters:
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiters
-
removeDelimiters
Remove delimiters from a delimited name- Parameters:
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiters
-
removeDelimiters
Remove delimiters from a delimited name- Parameters:
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiters
-
isDelimited
Determines whether a name is delimited.- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiters
-
isDelimited
Determines whether a name is delimited.- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiters
-
requiresDelimiters
Determines whether a name requires delimiters based upon:- The SQL-92 Reference definition of a valid unquoted name
- The naming rule specified
- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiting requirements
-
requiresDelimiters
Determines whether a name requires delimiters based upon:- The SQL-92 Reference definition of a valid unquoted name
- The naming rule specified
- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiting requirements
-
combineNames
Combines names using delimiting rules and appropriate separators- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
Combines names using delimiting rules and appropriate separators- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
Combines names using the specified delimiting rule and appropriate separators- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
Combines names using the specified delimiting rule and appropriate separators- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
Combines two names using delimiting rules and appropriate separators -
combineNames
Combines two names using delimiting rules and appropriate separators -
joinNames
Joins several names with different naming rules into a single string using appropriate delimiters and separators -
joinNames
Joins several names with different naming rules into a single string using appropriate delimiters and separators -
joinNames
Joins several names with different naming rules into a single string using appropriate delimiters and separators -
joinNames
Joins several names with different naming rules into a single string using appropriate delimiters and separators -
joinNames
Joins several names with different naming rules into a single string using the specified delimiter -
joinNames
Joins several names with different naming rules into a single string using the specified delimiter -
splitName
Splits a combined name name using the provided naming rule- Parameters:
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
splitName
Splits a combined name name using the provided naming rule- Parameters:
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
splitName
Splits a combined name name using the provided naming rule and delimiter.- Parameters:
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
splitName
Splits a combined name name using the provided naming rule and delimiter.- Parameters:
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
isReservedWord
Returns whether a name is considered a reserved word -
isReservedWord
Returns whether a name is considered a reserved word -
convert
Convert the string using this naming configuration to the supplied naming configuration. -
truncateName
Truncates a name while maintaining delimiters. -
truncateName
Truncates a name while maintaining delimiters. -
appendNames
Append the names together while maintaining delimiters. -
appendNames
Append the names together while maintaining delimiters. -
convertFull
Converts a qualified string-based name defined using the base configuration to the specified configuration. Returns the converted name. -
removeHungarianNotation
Removes Hungarian notation from the specified string. -
removeHungarianNotation
Removes Hungarian notation from the specified string. -
canSplit
Determines whether a name can be split into multiple components. -
canSplit
Determines whether a name can be split into multiple components. -
canSplit
Determines whether a name can be split into multiple components, taking into account the specified delimiter. -
canSplit
Determines whether a name can be split into multiple components, taking into account the specified delimiter.
-