java.lang.Object
com.aoindustries.aoserv.client.sql.Parser
Static utilities for use in SQL parsing.
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
indexOfNotQuoted
(String expr, char ch) Find a match only outside quoted section of the expressions.static int
indexOfNotQuoted
(String expr, char ch, int fromIndex) Find a match only outside quoted section of the expressions.static int
indexOfNotQuoted
(String expr, String str) Find a match only outside quoted section of the expressions.static int
indexOfNotQuoted
(String expr, String str, int fromIndex) Find a match only outside quoted section of the expressions.static SqlExpression
parseSqlExpression
(AoservTable<?, ?> table, String expr) static String
Quotes a string if needed.static String
Unquotes a string, removing " characters, except "" being the escape for a " within a quoted section.
-
Method Details
-
indexOfNotQuoted
Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section. -
indexOfNotQuoted
Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section. -
indexOfNotQuoted
Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section. -
indexOfNotQuoted
Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section. -
unquote
Unquotes a string, removing " characters, except "" being the escape for a " within a quoted section. -
quote
Quotes a string if needed. Currently this only when is empty, contains " or . or a character outside normal ASCII range. Unicode is not considered for use without quoting, since this is only used to quote AOServ table/column names, which are all ASCII. -
parseSqlExpression
public static SqlExpression parseSqlExpression(AoservTable<?, ?> table, String expr) throws SQLException, IOException- Throws:
SQLException
IOException
-