public class IdentifierUtilImpl extends Object implements IdentifierUtil, Configurable
BAR, CASE_LOWER, CASE_PRESERVE, CASE_UPPER, DOLLAR_CHAR, DOT, DOUBLE_QUOTE, EMPTY, PERCENT, SPACE, UNDERSCORE, UNDERSCORE_CHAR
Constructor and Description |
---|
IdentifierUtilImpl() |
IdentifierUtilImpl(IdentifierConfiguration config) |
Modifier and Type | Method and Description |
---|---|
String |
appendNames(IdentifierRule rule,
String name1,
String name2)
Append the names together while maintaining delimiters.
|
String |
appendNames(String rule,
String name1,
String name2)
Append the names together while maintaining delimiters.
|
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.
|
boolean |
canSplit(String rule,
String name)
Determines whether a name can be split into multiple components.
|
boolean |
canSplit(String rule,
String name,
String delim)
Determines whether a name can be split into multiple components, taking
into account the specified delimiter.
|
String |
combineFull(IdentifierConfiguration config,
String rule,
String fullName) |
String |
combineNames(IdentifierConfiguration config,
IdentifierRule rule,
IdentifierRule[] rules,
String[] names) |
String |
combineNames(IdentifierConfiguration config,
IdentifierRule namingRule,
String[] names) |
String |
combineNames(IdentifierConfiguration config,
IdentifierRule rule,
String name1,
String name2) |
String |
combineNames(IdentifierConfiguration config,
String rule,
String[] names) |
String |
combineNames(IdentifierRule rule,
IdentifierRule[] rules,
String[] names)
Combines names using delimiting rules and appropriate separators
|
String |
combineNames(IdentifierRule rule,
String[] names)
Combines names using the specified delimiting rule and appropriate separators
|
String |
combineNames(IdentifierRule rule,
String name1,
String name2)
Combines two names using delimiting rules and appropriate separators
|
String |
combineNames(String rule,
String[] names)
Combines names using the specified delimiting rule and appropriate separators
|
String |
combineNames(String rule,
String[] rules,
String[] names)
Combines names using delimiting rules and appropriate separators
|
String |
combineNames(String rule,
String name1,
String name2)
Combines two names using delimiting rules and appropriate separators
|
String |
convert(IdentifierConfiguration config,
String rule,
String name)
Convert the string using this naming configuration to the supplied
naming configuration.
|
String |
convertFull(IdentifierConfiguration config,
String rule,
String fullName)
Converts a qualified string-based name defined using the base configuration to the
specified configuration.
|
String |
delimit(IdentifierConfiguration config,
IdentifierRule rule,
String name) |
String |
delimit(IdentifierConfiguration config,
IdentifierRule rule,
String name,
boolean force) |
String |
delimit(IdentifierRule rule,
String name)
Delimit the name if it requires delimiters
|
String |
delimit(IdentifierRule rule,
String name,
boolean force)
Delimit the string with the option to force delimiting.
|
String |
delimit(String rule,
String name)
Delimit the name if it requires delimiters
|
String |
delimit(String rule,
String name,
boolean force)
Delimit the string with the option to force delimiting.
|
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object.
|
IdentifierConfiguration |
getIdentifierConfiguration()
Get the naming configuration.
|
boolean |
isDelimited(IdentifierConfiguration config,
IdentifierRule rule,
String name) |
boolean |
isDelimited(IdentifierRule rule,
String name)
Determines whether a name is delimited.
|
boolean |
isDelimited(String rule,
String name)
Determines whether a name is delimited.
|
static boolean |
isDoubleQuoted(String name)
Returns whether a name is double quoted
|
boolean |
isReservedWord(IdentifierRule rule,
String name)
Returns whether a name is considered a reserved word.
|
boolean |
isReservedWord(String rule,
String name)
Returns whether a name is considered a reserved word
|
String |
joinNames(IdentifierConfiguration config,
IdentifierRule rule,
String[] names,
String delimiter)
Join names using a single naming rule and specified delimiter
|
String |
joinNames(IdentifierRule[] rules,
String[] names)
Joins multiple names together using the standard delimiting rules
ex. ( {"s", "t", "c"} --> "s"."
|
String |
joinNames(IdentifierRule rule,
String[] names)
Joins several names with different naming rules into a single string
using appropriate delimiters and separators
|
String |
joinNames(IdentifierRule rule,
String[] names,
String delimiter)
Joins several names with different naming rules into a single string
using the specified delimiter
|
String |
joinNames(String[] rules,
String[] names)
Joins several names with different naming rules into a single string
using appropriate delimiters and separators
|
String |
joinNames(String rule,
String[] names)
Joins several names with different naming rules into a single string
using appropriate delimiters and separators
|
String |
joinNames(String rule,
String[] names,
String delimiter)
Joins several names with different naming rules into a single string
using the specified delimiter
|
protected boolean |
needsConversion(IdentifierConfiguration config) |
String |
removeDelimiters(IdentifierConfiguration config,
IdentifierRule rule,
String name) |
protected String |
removeDelimiters(IdentifierConfiguration config,
IdentifierRule rule,
String name,
String leading,
String trailing) |
String |
removeDelimiters(IdentifierConfiguration config,
String rule,
String name)
Remove delimiters from a delimited name
|
String |
removeDelimiters(IdentifierRule rule,
String name)
Remove delimiters from a delimited name
|
String |
removeDelimiters(String rule,
String name)
Remove delimiters from a delimited name
|
String |
removeHungarianNotation(IdentifierRule rule,
String name)
Removes Hungarian notation from the specified string.
|
String |
removeHungarianNotation(String rule,
String name)
Removes Hungarian notation from the specified string.
|
boolean |
requiresDelimiters(IdentifierConfiguration config,
IdentifierRule rule,
String name) |
boolean |
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 specified
|
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 specified
|
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.
|
void |
setIdentifierConfiguration(IdentifierConfiguration config)
Set the naming configuration to use for naming operations.
|
String[] |
splitName(IdentifierConfiguration config,
IdentifierRule nrule,
String name) |
String[] |
splitName(IdentifierConfiguration config,
String rule,
String name) |
String[] |
splitName(IdentifierRule nrule,
String name)
Splits a combined name name using the provided naming rule
|
String[] |
splitName(IdentifierRule nrule,
String name,
String nameDelim)
Splits names using single naming rule and appropriate separators
|
String[] |
splitName(String rule,
String name)
Splits a combined name name using the provided naming rule
|
String[] |
splitName(String nrule,
String name,
String nameDelim)
Splits a combined name name using the provided naming rule and
delimiter.
|
void |
startConfiguration()
Invoked before bean property configuration is begun on this object.
|
String |
truncateName(IdentifierRule namingRule,
String name,
int length)
Truncates a name while maintaining delimiters.
|
String |
truncateName(String rule,
String name,
int length)
Truncates a name while maintaining delimiters.
|
public IdentifierUtilImpl()
public IdentifierUtilImpl(IdentifierConfiguration config)
public void setIdentifierConfiguration(IdentifierConfiguration config)
IdentifierUtil
setIdentifierConfiguration
in interface IdentifierUtil
public IdentifierConfiguration getIdentifierConfiguration()
IdentifierUtil
getIdentifierConfiguration
in interface IdentifierUtil
public String combineNames(String rule, String name1, String name2)
IdentifierUtil
combineNames
in interface IdentifierUtil
public String combineNames(String rule, String[] names)
IdentifierUtil
combineNames
in interface IdentifierUtil
public String combineNames(IdentifierConfiguration config, String rule, String[] names)
public String combineNames(IdentifierRule rule, IdentifierRule[] rules, String[] names)
IdentifierUtil
combineNames
in interface IdentifierUtil
public String combineNames(IdentifierConfiguration config, IdentifierRule rule, IdentifierRule[] rules, String[] names)
public String combineNames(IdentifierConfiguration config, IdentifierRule rule, String name1, String name2)
public String combineNames(IdentifierConfiguration config, IdentifierRule namingRule, String[] names)
public String appendNames(IdentifierRule rule, String name1, String name2)
IdentifierUtil
appendNames
in interface IdentifierUtil
public String joinNames(IdentifierRule[] rules, String[] names)
joinNames
in interface IdentifierUtil
public String joinNames(String rule, String[] names)
IdentifierUtil
joinNames
in interface IdentifierUtil
public String joinNames(IdentifierRule rule, String[] names)
IdentifierUtil
joinNames
in interface IdentifierUtil
public String joinNames(IdentifierRule rule, String[] names, String delimiter)
IdentifierUtil
joinNames
in interface IdentifierUtil
public String joinNames(String rule, String[] names, String delimiter)
IdentifierUtil
joinNames
in interface IdentifierUtil
public String joinNames(IdentifierConfiguration config, IdentifierRule rule, String[] names, String delimiter)
rule
- names
- public String[] splitName(IdentifierConfiguration config, IdentifierRule nrule, String name)
public String[] splitName(IdentifierRule nrule, String name)
IdentifierUtil
splitName
in interface IdentifierUtil
name
- the multi-value namepublic String[] splitName(IdentifierRule nrule, String name, String nameDelim)
splitName
in interface IdentifierUtil
name
- the multi-value namepublic static boolean isDoubleQuoted(String name)
public String delimit(IdentifierConfiguration config, IdentifierRule rule, String name)
public String delimit(IdentifierRule rule, String name)
IdentifierUtil
delimit
in interface IdentifierUtil
rule
- the rule to use for delimitingname
- the name to delimitpublic String delimit(IdentifierRule rule, String name, boolean force)
IdentifierUtil
delimit
in interface IdentifierUtil
rule
- the rule to use for delimitingname
- the name to delimitforce
- add delimiters even if delimiting is not requiredpublic String delimit(IdentifierConfiguration config, IdentifierRule rule, String name, boolean force)
public boolean isDelimited(IdentifierRule rule, String name)
IdentifierUtil
isDelimited
in interface IdentifierUtil
rule
- the rule to use for removing delimitersname
- the name to examine for delimiterspublic boolean isDelimited(IdentifierConfiguration config, IdentifierRule rule, String name)
public String removeDelimiters(IdentifierConfiguration config, String rule, String name)
IdentifierUtil
removeDelimiters
in interface IdentifierUtil
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiterspublic String removeDelimiters(IdentifierRule rule, String name)
IdentifierUtil
removeDelimiters
in interface IdentifierUtil
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiterspublic String removeDelimiters(IdentifierConfiguration config, IdentifierRule rule, String name)
public boolean requiresDelimiters(IdentifierRule rule, String name)
IdentifierUtil
requiresDelimiters
in interface IdentifierUtil
rule
- the rule to use for removing delimitersname
- the name to examine for delimiting requirementspublic boolean requiresDelimiters(IdentifierConfiguration config, IdentifierRule rule, String name)
public boolean isReservedWord(IdentifierRule rule, String name)
isReservedWord
in interface IdentifierUtil
public boolean isReservedWord(String rule, String name)
IdentifierUtil
isReservedWord
in interface IdentifierUtil
protected String removeDelimiters(IdentifierConfiguration config, IdentifierRule rule, String name, String leading, String trailing)
public String combineNames(String rule, String[] rules, String[] names)
IdentifierUtil
combineNames
in interface IdentifierUtil
public String truncateName(String rule, String name, int length)
IdentifierUtil
truncateName
in interface IdentifierUtil
public String truncateName(IdentifierRule namingRule, String name, int length)
IdentifierUtil
truncateName
in interface IdentifierUtil
public String delimit(String rule, String name)
IdentifierUtil
delimit
in interface IdentifierUtil
rule
- the rule to use for delimitingname
- the name to delimitpublic String delimit(String rule, String name, boolean force)
IdentifierUtil
delimit
in interface IdentifierUtil
rule
- the rule to use for delimitingname
- the name to delimitforce
- add delimiters even if delimiting is not requiredpublic boolean isDelimited(String rule, String name)
IdentifierUtil
isDelimited
in interface IdentifierUtil
rule
- the rule to use for removing delimitersname
- the name to examine for delimiterspublic String removeDelimiters(String rule, String name)
IdentifierUtil
removeDelimiters
in interface IdentifierUtil
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiterspublic boolean requiresDelimiters(String rule, String name)
IdentifierUtil
requiresDelimiters
in interface IdentifierUtil
rule
- the rule to use for removing delimitersname
- the name to examine for delimiting requirementspublic String[] splitName(IdentifierConfiguration config, String rule, String name)
public String[] splitName(String rule, String name)
IdentifierUtil
splitName
in interface IdentifierUtil
name
- the multi-value namepublic String joinNames(String[] rules, String[] names)
IdentifierUtil
joinNames
in interface IdentifierUtil
public String appendNames(String rule, String name1, String name2)
IdentifierUtil
appendNames
in interface IdentifierUtil
public String removeHungarianNotation(IdentifierRule rule, String name)
IdentifierUtil
removeHungarianNotation
in interface IdentifierUtil
public String removeHungarianNotation(String rule, String name)
IdentifierUtil
removeHungarianNotation
in interface IdentifierUtil
public String[] splitName(String nrule, String name, String nameDelim)
IdentifierUtil
splitName
in interface IdentifierUtil
name
- the multi-value namepublic String convert(IdentifierConfiguration config, String rule, String name)
IdentifierUtil
convert
in interface IdentifierUtil
public String convertFull(IdentifierConfiguration config, String rule, String fullName)
IdentifierUtil
convertFull
in interface IdentifierUtil
public String combineFull(IdentifierConfiguration config, String rule, String fullName)
protected boolean needsConversion(IdentifierConfiguration config)
public void endConfiguration()
Configurable
endConfiguration
in interface Configurable
public void setConfiguration(Configuration conf)
Configurable
setConfiguration
in interface Configurable
public void startConfiguration()
Configurable
startConfiguration
in interface Configurable
public boolean canSplit(String rule, String name)
IdentifierUtil
canSplit
in interface IdentifierUtil
public boolean canSplit(IdentifierRule rule, String name)
IdentifierUtil
canSplit
in interface IdentifierUtil
public boolean canSplit(String rule, String name, String delim)
IdentifierUtil
canSplit
in interface IdentifierUtil
public boolean canSplit(IdentifierRule rule, String name, String delim)
IdentifierUtil
canSplit
in interface IdentifierUtil
public String combineNames(IdentifierRule rule, String[] names)
IdentifierUtil
combineNames
in interface IdentifierUtil
public String combineNames(IdentifierRule rule, String name1, String name2)
IdentifierUtil
combineNames
in interface IdentifierUtil
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.