Class Normalizer
java.lang.Object
org.apache.openjpa.jdbc.identifier.Normalizer
Static utility class used for operating on string based identifiers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Appends one string to another using default identifier rules.static boolean
Determines whether a name can be split into multiple components.static boolean
Determines whether a name can be split into multiple components, taking into account the specified delimiter.static String
Combines multiple names using default identifier rules.static String
Combines two names using default identifier rules.static String
convert
(IdentifierConfiguration config, String rule, String name) Convert a normalized name to a name using the specified configuration and naming rule.static String
Delimits a string if necessary, optionally forcing it to be delimited.static boolean
fullNamesEqual
(String name1, String name2) Splits names into individual components and compares individually for equalitystatic IdentifierConfiguration
static boolean
isDelimited
(String name) Returns true if the name is delimited with default delimitersstatic String
Joins multiple names using default identifier rules.static String
Joins multiple names using the specified delimiter.static String
Joins two names using the default identifier rules.static boolean
namesEqual
(String name1, String name2) Compares two string names for equality.static String
normalizeMulti
(String name) Normalizes a multi-part namestatic String
normalizeString
(String name) Normalizes a single part namestatic String
normalizeUpper
(String name) Normalizes a name, if not delimited, converts to uppercase.static String
removeDelimiters
(String name) Removes default delimiters from a string.static String
Removes Hungarian notation from a string.static String[]
Splits a name into normalized componentsstatic String[]
Splits a name into normalized components using the specified name delimiter (ex. schema:table, delim = : --> { schema, table }static String
Truncates a name to the specified length while maintaining delimiters.
-
Constructor Details
-
Normalizer
public Normalizer()
-
-
Method Details
-
getNamingConfiguration
-
normalizeMulti
Normalizes a multi-part name- Parameters:
name
-
-
normalizeString
Normalizes a single part name- Parameters:
name
-
-
isDelimited
Returns true if the name is delimited with default delimiters- Parameters:
name
-
-
fullNamesEqual
Splits names into individual components and compares individually for equality- Parameters:
name1
-name2
-
-
namesEqual
Compares two string names for equality. If delimited, does a case comparison. If not delimited, does a case insensitive comparison.- Parameters:
name1
-name2
-
-
normalizeUpper
Normalizes a name, if not delimited, converts to uppercase.- Parameters:
name
-
-
splitName
Splits a name into normalized components- Parameters:
name
-
-
splitName
Splits a name into normalized components using the specified name delimiter (ex. schema:table, delim = : --> { schema, table }- Parameters:
name
-
-
joinNames
Joins multiple names using default identifier rules.- Parameters:
names
-
-
joinNames
Joins multiple names using the specified delimiter.- Parameters:
names
-
-
joinNames
Joins two names using the default identifier rules.- Parameters:
names
-
-
truncate
Truncates a name to the specified length while maintaining delimiters.- Parameters:
name
-length
-
-
convert
Convert a normalized name to a name using the specified configuration and naming rule. Note: Currently only delimiters are converted.- Parameters:
config
-rule
-name
-
-
combine
Combines two names using default identifier rules.- Parameters:
name1
-name2
-
-
combine
Combines multiple names using default identifier rules.- Parameters:
name1
-name2
-
-
append
Appends one string to another using default identifier rules.- Parameters:
name1
-name2
-
-
removeHungarianNotation
Removes Hungarian notation from a string.- Parameters:
name1
-name2
-
-
removeDelimiters
Removes default delimiters from a string. -
delimit
Delimits a string if necessary, optionally forcing it to be delimited. -
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.
-