Class Normalizer
java.lang.Object
org.apache.openjpa.jdbc.identifier.Normalizer
Static utility class used for operating on string based identifiers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringAppends one string to another using default identifier rules.static booleanDetermines whether a name can be split into multiple components.static booleanDetermines whether a name can be split into multiple components, taking into account the specified delimiter.static StringCombines multiple names using default identifier rules.static StringCombines two names using default identifier rules.static Stringconvert(IdentifierConfiguration config, String rule, String name) Convert a normalized name to a name using the specified configuration and naming rule.static StringDelimits a string if necessary, optionally forcing it to be delimited.static booleanfullNamesEqual(String name1, String name2) Splits names into individual components and compares individually for equalitystatic IdentifierConfigurationstatic booleanisDelimited(String name) Returns true if the name is delimited with default delimitersstatic StringJoins multiple names using default identifier rules.static StringJoins multiple names using the specified delimiter.static StringJoins two names using the default identifier rules.static booleannamesEqual(String name1, String name2) Compares two string names for equality.static StringnormalizeMulti(String name) Normalizes a multi-part namestatic StringnormalizeString(String name) Normalizes a single part namestatic StringnormalizeUpper(String name) Normalizes a name, if not delimited, converts to uppercase.static StringremoveDelimiters(String name) Removes default delimiters from a string.static StringRemoves 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 StringTruncates 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.
-