Class IdentifierUtilImpl
java.lang.Object
org.apache.openjpa.lib.identifier.IdentifierUtilImpl
- All Implemented Interfaces:
Configurable
,IdentifierUtil
- Direct Known Subclasses:
DBIdentifierUtilImpl
Implementation class for the base identifier impl.
-
Field Summary
Fields inherited from interface org.apache.openjpa.lib.identifier.IdentifierUtil
BAR, CASE_LOWER, CASE_PRESERVE, CASE_UPPER, DOLLAR_CHAR, DOT, DOUBLE_QUOTE, EMPTY, PERCENT, SPACE, UNDERSCORE, UNDERSCORE_CHAR
-
Constructor 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.combineFull
(IdentifierConfiguration config, String rule, String fullName) 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
(IdentifierConfiguration config, String rule, String[] names) combineNames
(IdentifierConfiguration config, IdentifierRule namingRule, String[] names) combineNames
(IdentifierConfiguration config, IdentifierRule rule, String name1, String name2) combineNames
(IdentifierConfiguration config, IdentifierRule rule, IdentifierRule[] rules, String[] names) combineNames
(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
(IdentifierConfiguration config, IdentifierRule rule, String name) delimit
(IdentifierConfiguration config, IdentifierRule rule, String name, boolean force) 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.void
Invoked upon completion of bean property configuration for this object.Get the naming configuration.boolean
isDelimited
(String rule, String name) Determines whether a name is delimited.boolean
isDelimited
(IdentifierConfiguration config, IdentifierRule rule, String name) boolean
isDelimited
(IdentifierRule rule, String name) Determines whether a name is delimited.static boolean
isDoubleQuoted
(String name) Returns whether a name is double quotedboolean
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 word.Joins 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
(IdentifierConfiguration config, IdentifierRule rule, String[] names, String delimiter) Join names using a single naming rule and specified delimiterjoinNames
(IdentifierRule[] rules, String[] names) Joins multiple names together using the standard delimiting rules ex. ( {"s", "t", "c"} --> "s"."joinNames
(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 delimiterprotected boolean
removeDelimiters
(String rule, String name) Remove delimiters from a delimited nameremoveDelimiters
(IdentifierConfiguration config, String rule, String name) Remove delimiters from a delimited nameremoveDelimiters
(IdentifierConfiguration config, IdentifierRule rule, String name) protected String
removeDelimiters
(IdentifierConfiguration config, IdentifierRule rule, String name, String leading, String trailing) removeDelimiters
(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
(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 specifiedvoid
Invoked prior to setting bean properties.void
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
(IdentifierConfiguration config, String rule, String name) String[]
splitName
(IdentifierConfiguration config, IdentifierRule nrule, String name) String[]
splitName
(IdentifierRule nrule, String name) Splits a combined name name using the provided naming ruleString[]
splitName
(IdentifierRule nrule, String name, String nameDelim) Splits names using single naming rule and appropriate separatorsvoid
Invoked before bean property configuration is begun on this object.truncateName
(String rule, String name, int length) Truncates a name while maintaining delimiters.truncateName
(IdentifierRule namingRule, String name, int length) Truncates a name while maintaining delimiters.
-
Constructor Details
-
IdentifierUtilImpl
public IdentifierUtilImpl() -
IdentifierUtilImpl
-
-
Method Details
-
setIdentifierConfiguration
Description copied from interface:IdentifierUtil
Set the naming configuration to use for naming operations. A naming configuration must be set before calling any other methods.- Specified by:
setIdentifierConfiguration
in interfaceIdentifierUtil
-
getIdentifierConfiguration
Description copied from interface:IdentifierUtil
Get the naming configuration.- Specified by:
getIdentifierConfiguration
in interfaceIdentifierUtil
-
combineNames
Description copied from interface:IdentifierUtil
Combines two names using delimiting rules and appropriate separators- Specified by:
combineNames
in interfaceIdentifierUtil
-
combineNames
Description copied from interface:IdentifierUtil
Combines names using the specified delimiting rule and appropriate separators- Specified by:
combineNames
in interfaceIdentifierUtil
- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
-
combineNames
Description copied from interface:IdentifierUtil
Combines names using delimiting rules and appropriate separators- Specified by:
combineNames
in interfaceIdentifierUtil
- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
public String combineNames(IdentifierConfiguration config, IdentifierRule rule, IdentifierRule[] rules, String[] names) -
combineNames
public String combineNames(IdentifierConfiguration config, IdentifierRule rule, String name1, String name2) -
combineNames
public String combineNames(IdentifierConfiguration config, IdentifierRule namingRule, String[] names) -
appendNames
Description copied from interface:IdentifierUtil
Append the names together while maintaining delimiters.- Specified by:
appendNames
in interfaceIdentifierUtil
-
joinNames
Joins multiple names together using the standard delimiting rules ex. ( {"s", "t", "c"} --> "s"."t"."c" }- Specified by:
joinNames
in interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtil
Joins several names with different naming rules into a single string using appropriate delimiters and separators- Specified by:
joinNames
in interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtil
Joins several names with different naming rules into a single string using appropriate delimiters and separators- Specified by:
joinNames
in interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtil
Joins several names with different naming rules into a single string using the specified delimiter- Specified by:
joinNames
in interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtil
Joins several names with different naming rules into a single string using the specified delimiter- Specified by:
joinNames
in interfaceIdentifierUtil
-
joinNames
public String joinNames(IdentifierConfiguration config, IdentifierRule rule, String[] names, String delimiter) Join names using a single naming rule and specified delimiter- Parameters:
rule
-names
-
-
splitName
-
splitName
Description copied from interface:IdentifierUtil
Splits a combined name name using the provided naming rule- Specified by:
splitName
in interfaceIdentifierUtil
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
splitName
Splits names using single naming rule and appropriate separators- Specified by:
splitName
in interfaceIdentifierUtil
- Parameters:
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
isDoubleQuoted
Returns whether a name is double quoted -
delimit
-
delimit
Description copied from interface:IdentifierUtil
Delimit the name if it requires delimiters- Specified by:
delimit
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for delimitingname
- the name to delimit- Returns:
- the delimited name, if delimiting was necessary.
-
delimit
Description copied from interface:IdentifierUtil
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.- Specified by:
delimit
in interfaceIdentifierUtil
- 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
public String delimit(IdentifierConfiguration config, IdentifierRule rule, String name, boolean force) -
isDelimited
Description copied from interface:IdentifierUtil
Determines whether a name is delimited.- Specified by:
isDelimited
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiters
-
isDelimited
-
removeDelimiters
Description copied from interface:IdentifierUtil
Remove delimiters from a delimited name- Specified by:
removeDelimiters
in interfaceIdentifierUtil
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiters
-
removeDelimiters
Description copied from interface:IdentifierUtil
Remove delimiters from a delimited name- Specified by:
removeDelimiters
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiters
-
removeDelimiters
-
requiresDelimiters
Description copied from interface:IdentifierUtil
Determines whether a name requires delimiters based upon:- The SQL-92 Reference definition of a valid unquoted name
- The naming rule specified
- Specified by:
requiresDelimiters
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiting requirements
-
requiresDelimiters
-
isReservedWord
Returns whether a name is considered a reserved word.- Specified by:
isReservedWord
in interfaceIdentifierUtil
-
isReservedWord
Description copied from interface:IdentifierUtil
Returns whether a name is considered a reserved word- Specified by:
isReservedWord
in interfaceIdentifierUtil
-
removeDelimiters
protected String removeDelimiters(IdentifierConfiguration config, IdentifierRule rule, String name, String leading, String trailing) -
combineNames
Description copied from interface:IdentifierUtil
Combines names using delimiting rules and appropriate separators- Specified by:
combineNames
in interfaceIdentifierUtil
- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
truncateName
Description copied from interface:IdentifierUtil
Truncates a name while maintaining delimiters.- Specified by:
truncateName
in interfaceIdentifierUtil
-
truncateName
Description copied from interface:IdentifierUtil
Truncates a name while maintaining delimiters.- Specified by:
truncateName
in interfaceIdentifierUtil
-
delimit
Description copied from interface:IdentifierUtil
Delimit the name if it requires delimiters- Specified by:
delimit
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for delimitingname
- the name to delimit- Returns:
- the delimited name, if delimiting was necessary.
-
delimit
Description copied from interface:IdentifierUtil
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.- Specified by:
delimit
in interfaceIdentifierUtil
- 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.
-
isDelimited
Description copied from interface:IdentifierUtil
Determines whether a name is delimited.- Specified by:
isDelimited
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiters
-
removeDelimiters
Description copied from interface:IdentifierUtil
Remove delimiters from a delimited name- Specified by:
removeDelimiters
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for removing delimitersname
- the name from which to remove delimiters
-
requiresDelimiters
Description copied from interface:IdentifierUtil
Determines whether a name requires delimiters based upon:- The SQL-92 Reference definition of a valid unquoted name
- The naming rule specified
- Specified by:
requiresDelimiters
in interfaceIdentifierUtil
- Parameters:
rule
- the rule to use for removing delimitersname
- the name to examine for delimiting requirements
-
splitName
-
splitName
Description copied from interface:IdentifierUtil
Splits a combined name name using the provided naming rule- Specified by:
splitName
in interfaceIdentifierUtil
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
joinNames
Description copied from interface:IdentifierUtil
Joins several names with different naming rules into a single string using appropriate delimiters and separators- Specified by:
joinNames
in interfaceIdentifierUtil
-
appendNames
Description copied from interface:IdentifierUtil
Append the names together while maintaining delimiters.- Specified by:
appendNames
in interfaceIdentifierUtil
-
removeHungarianNotation
Description copied from interface:IdentifierUtil
Removes Hungarian notation from the specified string.- Specified by:
removeHungarianNotation
in interfaceIdentifierUtil
-
removeHungarianNotation
Description copied from interface:IdentifierUtil
Removes Hungarian notation from the specified string.- Specified by:
removeHungarianNotation
in interfaceIdentifierUtil
-
splitName
Description copied from interface:IdentifierUtil
Splits a combined name name using the provided naming rule and delimiter.- Specified by:
splitName
in interfaceIdentifierUtil
name
- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
convert
Description copied from interface:IdentifierUtil
Convert the string using this naming configuration to the supplied naming configuration.- Specified by:
convert
in interfaceIdentifierUtil
-
convertFull
Description copied from interface:IdentifierUtil
Converts a qualified string-based name defined using the base configuration to the specified configuration. Returns the converted name.- Specified by:
convertFull
in interfaceIdentifierUtil
-
combineFull
-
needsConversion
-
endConfiguration
public void endConfiguration()Description copied from interface:Configurable
Invoked upon completion of bean property configuration for this object.- Specified by:
endConfiguration
in interfaceConfigurable
-
setConfiguration
Description copied from interface:Configurable
Invoked prior to setting bean properties.- Specified by:
setConfiguration
in interfaceConfigurable
-
startConfiguration
public void startConfiguration()Description copied from interface:Configurable
Invoked before bean property configuration is begun on this object.- Specified by:
startConfiguration
in interfaceConfigurable
-
canSplit
Description copied from interface:IdentifierUtil
Determines whether a name can be split into multiple components.- Specified by:
canSplit
in interfaceIdentifierUtil
-
canSplit
Description copied from interface:IdentifierUtil
Determines whether a name can be split into multiple components.- Specified by:
canSplit
in interfaceIdentifierUtil
-
canSplit
Description copied from interface:IdentifierUtil
Determines whether a name can be split into multiple components, taking into account the specified delimiter.- Specified by:
canSplit
in interfaceIdentifierUtil
-
canSplit
Description copied from interface:IdentifierUtil
Determines whether a name can be split into multiple components, taking into account the specified delimiter.- Specified by:
canSplit
in interfaceIdentifierUtil
-
combineNames
Description copied from interface:IdentifierUtil
Combines names using the specified delimiting rule and appropriate separators- Specified by:
combineNames
in interfaceIdentifierUtil
- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
Description copied from interface:IdentifierUtil
Combines two names using delimiting rules and appropriate separators- Specified by:
combineNames
in interfaceIdentifierUtil
-