Class Quoting
java.lang.Object
net.sf.jailer.util.Quoting
Quotes and un-quotes SQL identifier in a DBMS specific way.
- Author:
- Ralf Wisser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCompares a String to another String, ignoring case considerations and quoting.static booleanChecks whether a SQL LIKE search pattern matches a candidate, ignoring quoting and case.static booleanequalsWROSearchPattern(String a, String cand1, String cand2) Checks whether a SQL LIKE search pattern matches either of two candidates, ignoring quoting and case.getQuote()Gets the quote character, null if quoting is not supported.static QuotinggetQuoting(Session session) Gets theQuotingfor a given session.booleanhasCorrectCase(String identifier) Checks whether an identifier has the correct case to be used unquoted.static booleanisPotentialIdentifierQuote(char c) Checks if a character is a potential identifier quote character.booleanChecks if an identifier is quoted.normalizeCase(String identifier) Normalizes the case of an unquoted identifier according to the database's case rules.static StringnormalizeIdentifier(String identifier) Normalizes an identifier.Quotes an identifier.Quotes an identifier only if it is already quoted (potentially with a different quoting-string).Quotes an identifier only if it is already quoted (potentially with a different quoting-string).static StringstaticUnquote(String identifier) Remove quotes from identifier.Remove quotes from identifier.static StringunquotedTableName(Table t, ExecutionContext executionContext) Gets unquoted qualified table name.withIdentifierQuoteString(String identifierQuoteString) Creates a newQuotingwith a different identifier quote string.
-
Field Details
-
UCSQL2003KEYWORDS
-
-
Constructor Details
-
Quoting
Constructor.- Parameters:
session- the database session- Throws:
SQLException
-
-
Method Details
-
getQuoting
Gets theQuotingfor a given session.- Parameters:
session- the database session- Returns:
- the
Quotinginstance for the session - Throws:
SQLException
-
quote
-
hasCorrectCase
Checks whether an identifier has the correct case to be used unquoted.- Parameters:
identifier- the identifier to check- Returns:
trueif the identifier can be used without quoting
-
isQuoted
Checks if an identifier is quoted.- Parameters:
identifier- the identifier- Returns:
trueif identifier is quoted
-
unquote
-
staticUnquote
-
requote
-
requote
-
unquotedTableName
Gets unquoted qualified table name.- Parameters:
t- the table- Returns:
- unquoted qualified name of t
-
getQuote
Gets the quote character, null if quoting is not supported.- Returns:
- the quote character, null if quoting is not supported
-
isPotentialIdentifierQuote
public static boolean isPotentialIdentifierQuote(char c) Checks if a character is a potential identifier quote character.- Parameters:
c- the character to check- Returns:
trueif the character can be used as an identifier quote
-
withIdentifierQuoteString
-
normalizeIdentifier
-
normalizeCase
-
equalsIgnoreQuotingAndCase
-
equalsWROSearchPattern
Checks whether a SQL LIKE search pattern matches either of two candidates, ignoring quoting and case.- Parameters:
a- the search patterncand1- the first candidatecand2- the second candidate- Returns:
trueif the pattern matches either candidate
-
equalsWROSearchPattern
-