- All Superinterfaces:
- Scope
A publicly available API for the internal parse context that allows for
 parsing SQL fragements.
 
 This type is a Scope with independent lifecycle and its own
 Scope.data() map.
- Author:
- Lukas Eder
- 
Method SummaryModifier and TypeMethodDescriptioncharThe character at the currentposition().charcharacter(int pos) The character at positionposition(int).char @NotNull []Get access to the underlying SQL string.@NotNull ParseContextcharacters(char[] newCharacters) Update the underlying SQL string.@NotNull ParserExceptionAn exception that can be thrown from the current position.@NotNull LanguageContextThe current language context.booleanparse(char c) Parse a single character or fail if it cannot be parsed.booleanParse a string or fail if it cannot be parsed.@NotNull SQLDialectCategoryConvenient access toSettings.getParseDialect()'s category.@NotNull ConditionParse aConditionexpression or fail if the current expression is not a condition.@NotNull DataType<?> Parse aDataTypeexpression or fail if the current expression is not a data type.@NotNull SQLDialectConvenient access toSettings.getParseDialect().@NotNull SQLDialectConvenient access toSettings.getParseDialect()'s family.@NotNull Field<?> Parse aFieldexpression or fail if the current expression is not a field.booleanparseFunctionNameIf(String name) Try parsing a function name.booleanparseFunctionNameIf(String... names) Try parsing any function name.@NotNull NameParse an (unqualified) identifier or fail if the current token is not an identifier.@Nullable NameTry parsing an (unqualified) identifier.booleanparseIf(char c) Try parsing a single character.booleanTry parsing a string.booleanparseKeyword(String keyword) Parse a keyword or fail if the keyword cannot be parsed.booleanparseKeyword(String... keywords) Parse any keyword or fail if none of the keywords could be parsed.booleanparseKeywordIf(String keyword) Try parsing a keyword.booleanparseKeywordIf(String... keywords) Try parsing any keyword.<T> @NotNull List<T> parseList(String separator, Function<? super ParseContext, ? extends T> element) Convenience method to parse a list of at least 1 elements.<T> @NotNull List<T> parseList(Predicate<? super ParseContext> separator, Function<? super ParseContext, ? extends T> element) Convenience method to parse a list of at least 1 elements.@NotNull NameParse a name (a qualified identifier) or fail if the current token is not a name.@Nullable NameTry parsing a name (a qualified identifier).<T> TparseParenthesised(char open, Function<? super ParseContext, ? extends T> content, char close) Convenience method to parse parenthesised content.<T> TparseParenthesised(String open, Function<? super ParseContext, ? extends T> content, String close) Convenience method to parse parenthesised content.<T> TparseParenthesised(Function<? super ParseContext, ? extends T> content) Convenience method to parse parenthesised content.@NotNull LongParse a signed integer literal or fail if the current token is not a signed integer literal.@Nullable LongTry parsing an signed integer literal.@NotNull SortField<?> Parse aSortFieldexpression or fail if the current expression is not a sort field.@NotNull StringParse a string literal or fail if the current token is not a string literal.@Nullable StringTry parsing a string literal.@NotNull Table<?> Parse aTableexpression or fail if the current expression is not a table.@NotNull LongParse an unsigned integer literal or fail if the current token is not an unsigned integer literal.@Nullable LongTry parsing an unsigned integer literal.booleanpeek(char c) Peek at the next character.booleanPeek at the next characters.booleanpeekKeyword(String keyword) Peek at the next keyword.booleanpeekKeyword(String... keywords) Peek at the next keyword.intposition()The current position.booleanposition(int newPosition) Set the current position to a new one.Methods inherited from interface org.jooq.Scopeconfiguration, creationTime, data, data, data, dialect, dsl, family, settings
- 
Method Details- 
parseDialectConvenient access toSettings.getParseDialect().
- 
parseFamilyConvenient access toSettings.getParseDialect()'s family.
- 
parseCategoryConvenient access toSettings.getParseDialect()'s category.
- 
languageContextThe current language context.
- 
characterschar @NotNull [] characters()Get access to the underlying SQL string.
- 
charactersUpdate the underlying SQL string.This replaces the current SQL string being parsed by a new one. Callers must ensure this ParseContextmaintains a consistentcharacters()andposition().
- 
characterchar character()The character at the currentposition().
- 
characterchar character(int pos) The character at positionposition(int).
- 
positionint position()The current position.
- 
positionboolean position(int newPosition) Set the current position to a new one.- Returns:
- Always returns true.
 
- 
peekboolean peek(char c) Peek at the next character.- Returns:
- Whether the next character is the expected one.
- See Also:
 
- 
peekPeek at the next characters.- Returns:
- Whether the next characters are the expected ones.
- See Also:
 
- 
peekKeywordPeek at the next keyword.- Returns:
- Whether the next keyword is the expected one.
- See Also:
 
- 
peekKeywordPeek at the next keyword.- Returns:
- Whether the next keyword is any of the expected ones.
- See Also:
 
- 
parseParse a single character or fail if it cannot be parsed.- Returns:
- Always returns true.
- Throws:
- ParserException- if the character could not be parsed.
 
- 
parseIfboolean parseIf(char c) Try parsing a single character.- Returns:
- Whether the character could be parsed.
 
- 
parseParse a string or fail if it cannot be parsed.- Returns:
- Always returns true.
- Throws:
- ParserException- if the string could not be parsed.
 
- 
parseIfTry parsing a string.- Returns:
- Whether the string could be parsed.
 
- 
parseKeywordParse a keyword or fail if the keyword cannot be parsed.The argument keyword should be in UPPER CASE and is allowed to contain spaces. Spaces separating keyword parts are interpreted as any arbitrary amount of whitespace. For example, when parsing "ORDER BY", then"order by"will be parsed as well.- Returns:
- Always returns true.
- Throws:
- ParserException- if the keyword could not be parsed.
 
- 
parseKeywordIfTry parsing a keyword.The argument keyword should be in UPPER CASE and is allowed to contain spaces. Spaces separating keyword parts are interpreted as any arbitrary amount of whitespace. For example, when parsing "ORDER BY", then"order by"will be parsed as well.- Returns:
- Whether the keyword could be parsed.
 
- 
parseKeywordIfTry parsing any keyword.- Returns:
- Whether any of the keywords could be parsed.
 
- 
parseKeywordParse any keyword or fail if none of the keywords could be parsed.- Returns:
- Always returns true.
- Throws:
- ParserException- if none of the keywords could be parsed.
 
- 
parseIdentifierParse an (unqualified) identifier or fail if the current token is not an identifier.- Returns:
- The parsed identifier.
- Throws:
- ParserException- if no identifier could be parsed.
 
- 
parseIdentifierIfTry parsing an (unqualified) identifier.- Returns:
- The identifier if it could be parsed, or nullif the current token is not an identifier.
 
- 
parseNameParse a name (a qualified identifier) or fail if the current token is not a name.- Returns:
- The parsed name.
- Throws:
- ParserException- if no name could be parsed.
 
- 
parseNameIfTry parsing a name (a qualified identifier).- Returns:
- The name if it could be parsed, or nullif the current token is not a name.
 
- 
parseFunctionNameIfTry parsing a function name.- Returns:
- Whether the function name could be parsed.
 
- 
parseFunctionNameIfTry parsing any function name.- Returns:
- Whether any function name could be parsed.
 
- 
parseStringLiteralParse a string literal or fail if the current token is not a string literal.- Returns:
- The parsed string literal.
- Throws:
- ParserException- if no string literal could be parsed.
 
- 
parseStringLiteralIfTry parsing a string literal.- Returns:
- The string literal if it could be parsed, or nullif the current token is not a string literal.
 
- 
parseUnsignedIntegerLiteralParse an unsigned integer literal or fail if the current token is not an unsigned integer literal.- Returns:
- The unsigned integer literal.
- Throws:
- ParserException- if no unsigned integer literal could be parsed.
 
- 
parseUnsignedIntegerLiteralIfTry parsing an unsigned integer literal.- Returns:
- The unsigned integer literal if it could be parsed, or
         nullif the current token is not an unsigned integer literal.
 
- 
parseSignedIntegerLiteralParse a signed integer literal or fail if the current token is not a signed integer literal.- Returns:
- The signed integer literal.
- Throws:
- ParserException- if no signed integer literal could be parsed.
 
- 
parseSignedIntegerLiteralIfTry parsing an signed integer literal.- Returns:
- The signed integer literal if it could be parsed, or
         nullif the current token is not an signed integer literal.
 
- 
parseDataTypeParse aDataTypeexpression or fail if the current expression is not a data type.- Returns:
- The data type.
- Throws:
- ParserException- if no data type expression could be parsed.
 
- 
parseFieldParse aFieldexpression or fail if the current expression is not a field.- Returns:
- The parsed field.
- Throws:
- ParserException- if no field expression could be parsed.
 
- 
parseSortFieldParse aSortFieldexpression or fail if the current expression is not a sort field.- Returns:
- The parsed sort field.
- Throws:
- ParserException- if no sort field expression could be parsed.
 
- 
parseConditionParse aConditionexpression or fail if the current expression is not a condition.- Returns:
- The parsed condition.
- Throws:
- ParserException- if no condition expression could be parsed.
 
- 
parseTableParse aTableexpression or fail if the current expression is not a table.- Returns:
- The parsed table.
- Throws:
- ParserException- if no table expression could be parsed.
 
- 
parseList@NotNull <T> @NotNull List<T> parseList(String separator, Function<? super ParseContext, ? extends T> element) Convenience method to parse a list of at least 1 elements.
- 
parseList@NotNull <T> @NotNull List<T> parseList(Predicate<? super ParseContext> separator, Function<? super ParseContext, ? extends T> element) Convenience method to parse a list of at least 1 elements.
- 
parseParenthesisedConvenience method to parse parenthesised content.
- 
parseParenthesisedConvenience method to parse parenthesised content.
- 
parseParenthesised<T> T parseParenthesised(String open, Function<? super ParseContext, ? extends T> content, String close) Convenience method to parse parenthesised content.
- 
exceptionAn exception that can be thrown from the current position.
 
-