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
Constructors -
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.booleanDetermines whether a name can be split into multiple components.booleanDetermines whether a name can be split into multiple components, taking into account the specified delimiter.booleancanSplit(IdentifierRule rule, String name) Determines whether a name can be split into multiple components.booleancanSplit(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.voidInvoked upon completion of bean property configuration for this object.Get the naming configuration.booleanisDelimited(String rule, String name) Determines whether a name is delimited.booleanisDelimited(IdentifierConfiguration config, IdentifierRule rule, String name) booleanisDelimited(IdentifierRule rule, String name) Determines whether a name is delimited.static booleanisDoubleQuoted(String name) Returns whether a name is double quotedbooleanisReservedWord(String rule, String name) Returns whether a name is considered a reserved wordbooleanisReservedWord(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 booleanremoveDelimiters(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 StringremoveDelimiters(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.booleanrequiresDelimiters(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 specifiedbooleanrequiresDelimiters(IdentifierConfiguration config, IdentifierRule rule, String name) booleanrequiresDelimiters(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 specifiedvoidInvoked prior to setting bean properties.voidSet 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 separatorsvoidInvoked 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:IdentifierUtilSet the naming configuration to use for naming operations. A naming configuration must be set before calling any other methods.- Specified by:
setIdentifierConfigurationin interfaceIdentifierUtil
-
getIdentifierConfiguration
Description copied from interface:IdentifierUtilGet the naming configuration.- Specified by:
getIdentifierConfigurationin interfaceIdentifierUtil
-
combineNames
Description copied from interface:IdentifierUtilCombines two names using delimiting rules and appropriate separators- Specified by:
combineNamesin interfaceIdentifierUtil
-
combineNames
Description copied from interface:IdentifierUtilCombines names using the specified delimiting rule and appropriate separators- Specified by:
combineNamesin interfaceIdentifierUtil- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
-
combineNames
Description copied from interface:IdentifierUtilCombines names using delimiting rules and appropriate separators- Specified by:
combineNamesin 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:IdentifierUtilAppend the names together while maintaining delimiters.- Specified by:
appendNamesin interfaceIdentifierUtil
-
joinNames
Joins multiple names together using the standard delimiting rules ex. ( {"s", "t", "c"} --> "s"."t"."c" }- Specified by:
joinNamesin interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtilJoins several names with different naming rules into a single string using appropriate delimiters and separators- Specified by:
joinNamesin interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtilJoins several names with different naming rules into a single string using appropriate delimiters and separators- Specified by:
joinNamesin interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtilJoins several names with different naming rules into a single string using the specified delimiter- Specified by:
joinNamesin interfaceIdentifierUtil
-
joinNames
Description copied from interface:IdentifierUtilJoins several names with different naming rules into a single string using the specified delimiter- Specified by:
joinNamesin 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:IdentifierUtilSplits a combined name name using the provided naming rule- Specified by:
splitNamein interfaceIdentifierUtilname- 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:
splitNamein 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:IdentifierUtilDelimit the name if it requires delimiters- Specified by:
delimitin 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:IdentifierUtilDelimit 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:
delimitin 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:IdentifierUtilDetermines whether a name is delimited.- Specified by:
isDelimitedin interfaceIdentifierUtil- Parameters:
rule- the rule to use for removing delimitersname- the name to examine for delimiters
-
isDelimited
-
removeDelimiters
Description copied from interface:IdentifierUtilRemove delimiters from a delimited name- Specified by:
removeDelimitersin interfaceIdentifierUtilrule- the rule to use for removing delimitersname- the name from which to remove delimiters
-
removeDelimiters
Description copied from interface:IdentifierUtilRemove delimiters from a delimited name- Specified by:
removeDelimitersin interfaceIdentifierUtil- Parameters:
rule- the rule to use for removing delimitersname- the name from which to remove delimiters
-
removeDelimiters
-
requiresDelimiters
Description copied from interface:IdentifierUtilDetermines whether a name requires delimiters based upon:- The SQL-92 Reference definition of a valid unquoted name
- The naming rule specified
- Specified by:
requiresDelimitersin 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:
isReservedWordin interfaceIdentifierUtil
-
isReservedWord
Description copied from interface:IdentifierUtilReturns whether a name is considered a reserved word- Specified by:
isReservedWordin interfaceIdentifierUtil
-
removeDelimiters
protected String removeDelimiters(IdentifierConfiguration config, IdentifierRule rule, String name, String leading, String trailing) -
combineNames
Description copied from interface:IdentifierUtilCombines names using delimiting rules and appropriate separators- Specified by:
combineNamesin interfaceIdentifierUtil- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
truncateName
Description copied from interface:IdentifierUtilTruncates a name while maintaining delimiters.- Specified by:
truncateNamein interfaceIdentifierUtil
-
truncateName
Description copied from interface:IdentifierUtilTruncates a name while maintaining delimiters.- Specified by:
truncateNamein interfaceIdentifierUtil
-
delimit
Description copied from interface:IdentifierUtilDelimit the name if it requires delimiters- Specified by:
delimitin 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:IdentifierUtilDelimit 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:
delimitin 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:IdentifierUtilDetermines whether a name is delimited.- Specified by:
isDelimitedin interfaceIdentifierUtil- Parameters:
rule- the rule to use for removing delimitersname- the name to examine for delimiters
-
removeDelimiters
Description copied from interface:IdentifierUtilRemove delimiters from a delimited name- Specified by:
removeDelimitersin interfaceIdentifierUtil- Parameters:
rule- the rule to use for removing delimitersname- the name from which to remove delimiters
-
requiresDelimiters
Description copied from interface:IdentifierUtilDetermines whether a name requires delimiters based upon:- The SQL-92 Reference definition of a valid unquoted name
- The naming rule specified
- Specified by:
requiresDelimitersin interfaceIdentifierUtil- Parameters:
rule- the rule to use for removing delimitersname- the name to examine for delimiting requirements
-
splitName
-
splitName
Description copied from interface:IdentifierUtilSplits a combined name name using the provided naming rule- Specified by:
splitNamein interfaceIdentifierUtilname- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
joinNames
Description copied from interface:IdentifierUtilJoins several names with different naming rules into a single string using appropriate delimiters and separators- Specified by:
joinNamesin interfaceIdentifierUtil
-
appendNames
Description copied from interface:IdentifierUtilAppend the names together while maintaining delimiters.- Specified by:
appendNamesin interfaceIdentifierUtil
-
removeHungarianNotation
Description copied from interface:IdentifierUtilRemoves Hungarian notation from the specified string.- Specified by:
removeHungarianNotationin interfaceIdentifierUtil
-
removeHungarianNotation
Description copied from interface:IdentifierUtilRemoves Hungarian notation from the specified string.- Specified by:
removeHungarianNotationin interfaceIdentifierUtil
-
splitName
Description copied from interface:IdentifierUtilSplits a combined name name using the provided naming rule and delimiter.- Specified by:
splitNamein interfaceIdentifierUtilname- the multi-value name- Returns:
- individual components of the name ex. schema.table --> { schema, table }
-
convert
Description copied from interface:IdentifierUtilConvert the string using this naming configuration to the supplied naming configuration.- Specified by:
convertin interfaceIdentifierUtil
-
convertFull
Description copied from interface:IdentifierUtilConverts a qualified string-based name defined using the base configuration to the specified configuration. Returns the converted name.- Specified by:
convertFullin interfaceIdentifierUtil
-
combineFull
-
needsConversion
-
endConfiguration
public void endConfiguration()Description copied from interface:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
setConfiguration
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()Description copied from interface:ConfigurableInvoked before bean property configuration is begun on this object.- Specified by:
startConfigurationin interfaceConfigurable
-
canSplit
Description copied from interface:IdentifierUtilDetermines whether a name can be split into multiple components.- Specified by:
canSplitin interfaceIdentifierUtil
-
canSplit
Description copied from interface:IdentifierUtilDetermines whether a name can be split into multiple components.- Specified by:
canSplitin interfaceIdentifierUtil
-
canSplit
Description copied from interface:IdentifierUtilDetermines whether a name can be split into multiple components, taking into account the specified delimiter.- Specified by:
canSplitin interfaceIdentifierUtil
-
canSplit
Description copied from interface:IdentifierUtilDetermines whether a name can be split into multiple components, taking into account the specified delimiter.- Specified by:
canSplitin interfaceIdentifierUtil
-
combineNames
Description copied from interface:IdentifierUtilCombines names using the specified delimiting rule and appropriate separators- Specified by:
combineNamesin interfaceIdentifierUtil- Returns:
- a combined name ex. {"TH IS", THAT} -> "TH IS_THAT"
-
combineNames
Description copied from interface:IdentifierUtilCombines two names using delimiting rules and appropriate separators- Specified by:
combineNamesin interfaceIdentifierUtil
-