Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.jpa.internal.jpql.parser
Class AbstractExpression

java.lang.Object
  extended by org.eclipse.persistence.jpa.internal.jpql.parser.StringExpression
      extended by org.eclipse.persistence.jpa.internal.jpql.parser.AbstractExpression

All Implemented Interfaces:
Expression
Direct Known Subclasses:
AbstractConditionalClause, AbstractEncapsulatedExpression, AbstractFromClause, AbstractPathExpression, AbstractSchemaName, AbstractSelectClause, AbstractSelectStatement, ArithmeticFactor, BadExpression, BetweenExpression, CaseExpression, CollectionExpression, CollectionMemberDeclaration, CollectionMemberExpression, CompoundExpression, ConstructorExpression, DateTime, DeleteClause, DeleteStatement, EmptyCollectionComparisonExpression, EntityTypeLiteral, GroupByClause, IdentificationVariable, IdentificationVariableDeclaration, InExpression, InputParameter, Join, JoinFetch, JPQLExpression, KeywordExpression, LikeExpression, NotExpression, NullComparisonExpression, NullExpression, NumericLiteral, OrderByClause, OrderByItem, RangeVariableDeclaration, ResultVariable, StringLiteral, UnknownExpression, UpdateClause, UpdateItem, UpdateStatement, WhenClause

public abstract class AbstractExpression
extends StringExpression
implements Expression

This is the abstract definition of all the parts used to create the tree hierarchy representing the parsed JPQL query. It has the core of the parsing engine and of the content assist behavior (retrieval of the possible expression factories).

Since:
2.3
Version:
2.3
Author:
Pascal Filion
See Also:
ExpressionFactory, StringExpression

Field Summary
private  java.lang.String actualText
          The string representation of this Expression, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.
private  java.util.List<Expression> children
          The children of this AbstractExpression.
static char COMMA
          The constant for ','.
static char DOT
          The constant for '.'.
static char DOUBLE_QUOTE
          The constant for '"'.
static char LEFT_CURLY_BRACKET
          The constant for '{'.
static char LEFT_PARENTHESIS
          The constant for '('.
static char NOT_DEFINED
          The constant for a character that is not defined.
private  java.util.List<StringExpression> orderedChildren
          The string representation of this AbstractExpression.
private  AbstractExpression parent
          The parent of this expression or null if this is the root of the parsed tree hierarchy.
private  java.lang.String parsedText
          The string representation of this AbstractExpression.
private static ExpressionRegistry registry
          This registry keeps the single instances of various portion of the parser, which should increase performance the parsing process.
static char RIGHT_CURLY_BRACKET
          The constant for '}'.
static char RIGHT_PARENTHESIS
          The constant for ')'.
static char SINGLE_QUOTE
          The constant for '''.
static char SPACE
          The constant for ' '.
private  java.lang.String text
          If this expression has an identifier or a single value, then it's possible it's using this text to store it.
static char UNDERSCORE
          The constant for '_'.

 

Fields inherited from interface org.eclipse.persistence.jpa.internal.jpql.parser.Expression
ABS, ALL, AND, ANY, AS, ASC, AVG, BETWEEN, BIT_LENGTH, BOTH, CASE, CHAR_LENGTH, CHARACTER_LENGTH, CLASS, COALESCE, CONCAT, COUNT, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, DELETE, DELETE_FROM, DESC, DIFFERENT, DISTINCT, DIVISION, ELSE, EMPTY, END, ENTRY, EQUAL, ESCAPE, EXISTS, FALSE, FETCH, FROM, FUNC, GREATER_THAN, GREATER_THAN_OR_EQUAL, GROUP_BY, HAVING, IN, INDEX, INNER, INNER_JOIN, INNER_JOIN_FETCH, IS, IS_EMPTY, IS_NOT_EMPTY, IS_NOT_NULL, IS_NULL, JOIN, JOIN_FETCH, KEY, LEADING, LEFT, LEFT_JOIN, LEFT_JOIN_FETCH, LEFT_OUTER_JOIN, LEFT_OUTER_JOIN_FETCH, LENGTH, LIKE, LOCATE, LOWER, LOWER_THAN, LOWER_THAN_OR_EQUAL, MAX, MEMBER, MEMBER_OF, MIN, MINUS, MOD, MULTIPLICATION, NAMED_PARAMETER, NEW, NOT, NOT_BETWEEN, NOT_EXISTS, NOT_IN, NOT_LIKE, NOT_MEMBER, NOT_MEMBER_OF, NULL, NULLIF, OBJECT, OF, OR, ORDER_BY, OUTER, PLUS, POSITION, POSITIONAL_PARAMETER, QUOTE, SELECT, SET, SIZE, SOME, SQRT, SUBSTRING, SUM, THEN, TRAILING, TREAT, TRIM, TRUE, TYPE, UNKNOWN, UPDATE, UPPER, VALUE, WHEN, WHERE

 

Constructor Summary
AbstractExpression(AbstractExpression parent)
          Creates a new AbstractExpression.
AbstractExpression(AbstractExpression parent, java.lang.String text)
          Creates a new AbstractExpression.

 

Method Summary
(package private)  void addChildrenTo(java.util.Collection<Expression> children)
          Adds the children of this Expression to the given collection.
(package private)  void addOrderedChildrenTo(java.util.List<StringExpression> children)
          Adds the StringExpressions representing this Expression.
(package private)  AbstractExpression buildExpressionFromFallingBack(WordParser wordParser, java.lang.String word, JPQLQueryBNF queryBNF, AbstractExpression expression, boolean tolerant)
           
(package private)  AbstractExpression buildNullExpression()
          Creates a new null-Expression parented with this one.
(package private)  StringExpression buildStringExpression(char value)
          Creates a new StringExpression wrapping the given character value.
(package private)  StringExpression buildStringExpression(java.lang.String value)
          Creates a new StringExpression wrapping the given string value.
(package private)  AbstractExpression buildUnknownExpression(java.lang.String text)
          Creates an Expression that contains an malformed expression.
 java.util.ListIterator<Expression> children()
          Returns the children of this Expression.
(package private) static ExpressionFactory expressionFactory(java.lang.String expressionFactoryId)
          Retrieves the registered ExpressionFactory that was registered for the given unique identifier.
(package private) static ExpressionFactory expressionFactoryForIdentifier(java.lang.String identifier)
          Retrieves the registered ExpressionFactory that was registered for the given unique identifier.
private  ExpressionFactory findFallBackExpressionFactory(JPQLQueryBNF queryBNF)
           
 JPQLQueryBNF findQueryBNF(AbstractExpression expression)
          Retrieves the JPQLQueryBNF that was used to parse the given Expression.
 Expression[] getChildren()
          Returns the children of this Expression.
(package private)  IJPAVersion getJPAVersion()
          Returns the version of the Java Persistence to support.
 AbstractExpression getParent()
          Returns the parent of this Expression.
abstract  JPQLQueryBNF getQueryBNF()
          Returns the BNF of this Expression.
 JPQLExpression getRoot()
          Retrieves the root node of the parsed tree hierarchy.
(package private)  java.lang.String getText()
          Returns the encapsulated text of this AbstractExpression, which can be used in various ways, it can be a keyword, a literal, etc.
(package private)  boolean handleAggregate(JPQLQueryBNF queryBNF)
          Determines whether the given JPQLQueryBNF handles aggregate expressions.
static IdentifierRole identifierRole(java.lang.String identifier)
          Retrieves the role of the given identifier.
static java.util.Collection<java.lang.String> identifiers()
          Returns the set of identifiers used by the Java Persistence query language.
(package private)  java.lang.Iterable<java.lang.String> identifiers(java.lang.String queryBNFId)
          Retrieves the identifiers that are supported by the given BNF.
static IJPAVersion identifierVersion(java.lang.String identifier)
          Retrieves the JPA version in which the identifier was first introduced.
 boolean isAncestor(Expression expression)
          Determines whether this Expression is a parent of the given Expression.
static boolean isIdentifier(java.lang.String identifier)
          Determines if the given word is a JPQL identifier.
(package private)  boolean isNull()
          Determines whether this expression is a null Expression or any other subclass.
(package private)  boolean isParsingComplete(WordParser wordParser, java.lang.String word, Expression expression)
          Determines whether the parsing is complete based on what is left in the given text.
(package private)  boolean isTolerant()
          Determines if the parser is in tolerant mode or is in fast mode.
(package private)  boolean isUnknown()
          Determines whether this expression is an unknown Expression or any other subclass.
private  boolean isValidExpressionFactory(ExpressionFactory factory)
           
 boolean isVirtual()
          Determines whether this identification variable is virtual, meaning it's not part of the query but is required for proper navigability.
 java.util.ListIterator<StringExpression> orderedChildren()
          Creates a list representing this expression and its children.
(package private) abstract  void parse(WordParser wordParser, boolean tolerant)
          Parses the query by starting at the current position, which is part of the given WordParser.
(package private)  AbstractExpression parse(WordParser wordParser, JPQLQueryBNF queryBNF, boolean tolerant)
          Parses the given text by using the specified BNF.
private  AbstractExpression parse(WordParser wordParser, java.lang.String word, ExpressionFactory factory, JPQLQueryBNF queryBNF, AbstractExpression expression, boolean tolerant)
          Parses the given text.
(package private)  AbstractExpression parseSingleExpression(WordParser wordParser, JPQLQueryBNF queryBNF, boolean tolerant)
          Right away parses the text by retrieving the ExpressionFactory for the first word that is extracted from WordParser at the current location.
(package private)  void populatePosition(QueryPosition queryPosition, int position)
          Retrieves the StringExpression located at the given position using the actual query, which may have extra whitespace.
static
<T extends JPQLQueryBNF>
T
queryBNF(java.lang.String queryBNFID)
          Retrieves the BNF object that was registered for the given unique identifier.
(package private)  void readdLeadingSpaces(java.lang.StringBuilder text, int count)
          Adds spaces at the front of the given text.
(package private)  void rebuildActualText()
          Rebuilds the actual parsed text if it has been cached.
(package private)  void rebuildParsedText()
          Rebuilds the parsed parsed text if it has been cached.
(package private)  void setParent(AbstractExpression parent)
          Re-parents this Expression to be a child of the given Expression.
(package private)  void setText(java.lang.String text)
          Sets the text of this Expression.
(package private)  boolean shouldParseWithFactoryFirst()
          TODO
(package private)  boolean shouldSkipLiteral(AbstractExpression expression)
          When parsing an invalid or incomplete query, it is possible two literals would be parsed but in some cases, a CollectionExpression should not be created and the parsing should actually stop here.
 java.lang.String toActualText()
          Generates a string representation of this StringExpression, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.
 java.lang.String toParsedText()
          Returns a string representation of this StringExpression and its children.
(package private) abstract  void toParsedText(java.lang.StringBuilder writer, boolean includeVirtual)
          Generates a string representation of this Expression.
 java.lang.String toString()
          
private  AbstractExpression updateParsingInfo(AbstractExpression expression, AbstractExpression child, java.util.List<AbstractExpression> children, java.util.List<java.lang.Boolean> separatedByCommas, java.util.List<java.lang.Boolean> separatedBySpaces)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface org.eclipse.persistence.jpa.internal.jpql.parser.Expression
accept, acceptChildren

 

Field Detail

actualText

private java.lang.String actualText
The string representation of this Expression, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.
See Also:
toActualText()

children

private java.util.List<Expression> children
The children of this AbstractExpression.
See Also:
children()

orderedChildren

private java.util.List<StringExpression> orderedChildren
The string representation of this AbstractExpression.
See Also:
orderedChildren()

parent

private AbstractExpression parent
The parent of this expression or null if this is the root of the parsed tree hierarchy.

parsedText

private java.lang.String parsedText
The string representation of this AbstractExpression.
See Also:
toParsedText()

text

private java.lang.String text
If this expression has an identifier or a single value, then it's possible it's using this text to store it.

COMMA

public static final char COMMA
The constant for ','.
See Also:
Constant Field Values

DOT

public static final char DOT
The constant for '.'.
See Also:
Constant Field Values

DOUBLE_QUOTE

public static final char DOUBLE_QUOTE
The constant for '"'.
See Also:
Constant Field Values

LEFT_CURLY_BRACKET

public static final char LEFT_CURLY_BRACKET
The constant for '{'.
See Also:
Constant Field Values

LEFT_PARENTHESIS

public static final char LEFT_PARENTHESIS
The constant for '('.
See Also:
Constant Field Values

NOT_DEFINED

public static final char NOT_DEFINED
The constant for a character that is not defined.
See Also:
Constant Field Values

registry

private static final ExpressionRegistry registry
This registry keeps the single instances of various portion of the parser, which should increase performance the parsing process.

RIGHT_CURLY_BRACKET

public static final char RIGHT_CURLY_BRACKET
The constant for '}'.
See Also:
Constant Field Values

RIGHT_PARENTHESIS

public static final char RIGHT_PARENTHESIS
The constant for ')'.
See Also:
Constant Field Values

SINGLE_QUOTE

public static final char SINGLE_QUOTE
The constant for '''.
See Also:
Constant Field Values

SPACE

public static final char SPACE
The constant for ' '.
See Also:
Constant Field Values

UNDERSCORE

public static final char UNDERSCORE
The constant for '_'.
See Also:
Constant Field Values

Constructor Detail

AbstractExpression

AbstractExpression(AbstractExpression parent)
Creates a new AbstractExpression.
Parameters:
parent - The parent of this expression

AbstractExpression

AbstractExpression(AbstractExpression parent,
                   java.lang.String text)
Creates a new AbstractExpression.
Parameters:
parent - The parent of this expression
text - The text to be stored in this expression, null cannot be passed

Method Detail

expressionFactory

static ExpressionFactory expressionFactory(java.lang.String expressionFactoryId)
Retrieves the registered ExpressionFactory that was registered for the given unique identifier.
Parameters:
expressionFactoryId - The unique identifier of the ExpressionFactory to retrieve
Returns:
The ExpressionFactory mapped with the given unique identifier

expressionFactoryForIdentifier

static ExpressionFactory expressionFactoryForIdentifier(java.lang.String identifier)
Retrieves the registered ExpressionFactory that was registered for the given unique identifier.
Parameters:
expressionFactoryId - The unique identifier of the ExpressionFactory to retrieve
Returns:
The ExpressionFactory mapped with the given unique identifier

identifierRole

public static IdentifierRole identifierRole(java.lang.String identifier)
Retrieves the role of the given identifier. A role helps to describe the purpose of the identifier in a query.
Parameters:
identifier - The identifier for which its role is requested
Returns:
The role of the given identifier

identifiers

public static java.util.Collection<java.lang.String> identifiers()
Returns the set of identifiers used by the Java Persistence query language.
Returns:
The identifiers used by JPQL

identifierVersion

public static IJPAVersion identifierVersion(java.lang.String identifier)
Retrieves the JPA version in which the identifier was first introduced.
Returns:
The version in which the identifier was introduced

isIdentifier

public static boolean isIdentifier(java.lang.String identifier)
Determines if the given word is a JPQL identifier. The check is case insensitive.
Parameters:
word - The word to test
Returns:
true if the word is an identifier, false otherwise

queryBNF

public static <T extends JPQLQueryBNF> T queryBNF(java.lang.String queryBNFID)
Retrieves the BNF object that was registered for the given unique identifier.
Parameters:
queryBNFID - The unique identifier of the JPQLQueryBNF to retrieve
Returns:
The JPQLQueryBNF representing a section of the grammar

addChildrenTo

void addChildrenTo(java.util.Collection<Expression> children)
Adds the children of this Expression to the given collection.
Parameters:
children - The collection used to store the children

addOrderedChildrenTo

void addOrderedChildrenTo(java.util.List<StringExpression> children)
Adds the StringExpressions representing this Expression.
Parameters:
children - The list used to store the string representation of this Expression

buildExpressionFromFallingBack

final AbstractExpression buildExpressionFromFallingBack(WordParser wordParser,
                                                        java.lang.String word,
                                                        JPQLQueryBNF queryBNF,
                                                        AbstractExpression expression,
                                                        boolean tolerant)

buildNullExpression

final AbstractExpression buildNullExpression()
Creates a new null-Expression parented with this one.
Returns:
A new null version of an Expression

buildStringExpression

final StringExpression buildStringExpression(char value)
Creates a new StringExpression wrapping the given character value.
Parameters:
value - The character to wrap as a StringExpression
Returns:
The StringExpression representation of the given identifier where the owning Expression is this one

buildStringExpression

final StringExpression buildStringExpression(java.lang.String value)
Creates a new StringExpression wrapping the given string value.
Parameters:
value - The string to wrap as a StringExpression
Returns:
The StringExpression representation of the given identifier where the owning Expression is this one

buildUnknownExpression

final AbstractExpression buildUnknownExpression(java.lang.String text)
Creates an Expression that contains an malformed expression.
Parameters:
text - The text causing the expression to be malformed
Returns:
A new Expression where #toText() returns the given text

children

public final java.util.ListIterator<Expression> children()
Returns the children of this Expression.
Specified by:
children in interface Expression
Returns:
The children of this Expression or an empty list if this Expression does not have children

findFallBackExpressionFactory

private ExpressionFactory findFallBackExpressionFactory(JPQLQueryBNF queryBNF)

findQueryBNF

public JPQLQueryBNF findQueryBNF(AbstractExpression expression)
Retrieves the JPQLQueryBNF that was used to parse the given Expression.
Parameters:
expression - The expression for which its BNF is needed
Returns:
The JPQLQueryBNF that was used to parse the given expression

getChildren

public final Expression[] getChildren()
Returns the children of this Expression.
Specified by:
getChildren in interface Expression
Returns:
The children of this Expression or an empty list if this Expression does not have children

getJPAVersion

IJPAVersion getJPAVersion()
Returns the version of the Java Persistence to support.
Returns:
The JPA version

getParent

public final AbstractExpression getParent()
Returns the parent of this Expression.
Specified by:
getParent in interface Expression
Returns:
The parent of this {@link Expression, which is never null except for the root of the tree

getQueryBNF

public abstract JPQLQueryBNF getQueryBNF()
Returns the BNF of this Expression.
Returns:
The JPQLQueryBNF, which represents the grammar of this Expression

getRoot

public final JPQLExpression getRoot()
Retrieves the root node of the parsed tree hierarchy.
Specified by:
getRoot in interface Expression
Returns:
The root of the Expression tree

getText

java.lang.String getText()
Returns the encapsulated text of this AbstractExpression, which can be used in various ways, it can be a keyword, a literal, etc.
Returns:
The full text of this expression or a keyword, or only what this expression encapsulates

handleAggregate

boolean handleAggregate(JPQLQueryBNF queryBNF)
Determines whether the given JPQLQueryBNF handles aggregate expressions.
Parameters:
queryBNF - The JPQLQueryBNF used to determine if the parsing should handle aggregate expressions
Returns:
true if the given BNF handles aggregate expressions; false otherwise

identifiers

final java.lang.Iterable<java.lang.String> identifiers(java.lang.String queryBNFId)
Retrieves the identifiers that are supported by the given BNF.
Parameters:
queryBNFId - The unique identifier of the BNF for which the supported identifiers are requested
Returns:
The list of JPQL identifiers that can be used with the BNF

isAncestor

public boolean isAncestor(Expression expression)
Determines whether this Expression is a parent of the given Expression.
Specified by:
isAncestor in interface Expression
Parameters:
expression - The Expression to verify its paternity with this Expression
Returns:
true if this Expression is the same as the given Expression or one of its parent; false otherwise

isNull

boolean isNull()
Determines whether this expression is a null Expression or any other subclass.
Returns:
false by default

isParsingComplete

boolean isParsingComplete(WordParser wordParser,
                          java.lang.String word,
                          Expression expression)
Determines whether the parsing is complete based on what is left in the given text. The text is never empty.
Parameters:
wordParser - The text to parse based on the current position of the cursor
word - The word that was retrieved from the given text, which is the first word in the text
expression - The Expression that has already been parsed
Returns:
true if the text no longer can't be parsed by the current expression; false if more can be parsed

isTolerant

boolean isTolerant()
Determines if the parser is in tolerant mode or is in fast mode. When the tolerant is turned on, it means the parser will attempt to parse incomplete or invalid queries.
Returns:
true if the parsing system should parse invalid or incomplete queries; false when the query is well-formed and valid

isUnknown

boolean isUnknown()
Determines whether this expression is an unknown Expression or any other subclass.
Returns:
false by default

isValidExpressionFactory

private boolean isValidExpressionFactory(ExpressionFactory factory)

isVirtual

public boolean isVirtual()
Determines whether this identification variable is virtual, meaning it's not part of the query but is required for proper navigability.
Returns:
true if this identification variable was virtually created to fully qualify path expression; false if it was parsed

orderedChildren

public final java.util.ListIterator<StringExpression> orderedChildren()
Creates a list representing this expression and its children. In order to add every piece of the expression, #addChildrenTo(Collection) is called.
Specified by:
orderedChildren in class StringExpression
Returns:
The StringExpressions representing this Expression

parse

abstract void parse(WordParser wordParser,
                    boolean tolerant)
Parses the query by starting at the current position, which is part of the given WordParser.
Parameters:
wordParser - The text to parse based on the current position of the cursor
tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries

parse

AbstractExpression parse(WordParser wordParser,
                         JPQLQueryBNF queryBNF,
                         boolean tolerant)
Parses the given text by using the specified BNF.
Parameters:
wordParser - The text to parse based on the current position of the cursor
queryBNF - The grammar used to retrieve the possible expression factories
tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
Returns:
The Expression representing the given sub-query

parse

private AbstractExpression parse(WordParser wordParser,
                                 java.lang.String word,
                                 ExpressionFactory factory,
                                 JPQLQueryBNF queryBNF,
                                 AbstractExpression expression,
                                 boolean tolerant)
Parses the given text. When the text starts with one of the identifiers returned by the ExpressionFactory, then the factory is used to create the expression.
Parameters:
wordParser - The text to parse based on the current position of the cursor
word - The current word to parse
factory - The factory used to determine if the text matches the criteria for it to create the expression
queryBNF - The BNF helping to parse the query
expression - The expression parsed prior to parse the text
tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
Returns:
A new expression containing a portion of the text or null if the text doesn't meet the criteria of the factory

parseSingleExpression

AbstractExpression parseSingleExpression(WordParser wordParser,
                                         JPQLQueryBNF queryBNF,
                                         boolean tolerant)
Right away parses the text by retrieving the ExpressionFactory for the first word that is extracted from WordParser at the current location.
Parameters:
wordParser - The text to parse based on the current position of the cursor
queryBNF - The grammar used to retrieve the expression factory
tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
Returns:
The Expression representing the given sub-query

populatePosition

final void populatePosition(QueryPosition queryPosition,
                            int position)
Retrieves the StringExpression located at the given position using the actual query, which may have extra whitespace.
Specified by:
populatePosition in class StringExpression
position - The array has one element and is the position of the StringExpression to retrieve

readdLeadingSpaces

final void readdLeadingSpaces(java.lang.StringBuilder text,
                              int count)
Adds spaces at the front of the given text.
Parameters:
text - The text to have spaces added at its beginning
count - The number of spaces to add

rebuildActualText

final void rebuildActualText()
Rebuilds the actual parsed text if it has been cached.

rebuildParsedText

final void rebuildParsedText()
Rebuilds the parsed parsed text if it has been cached.

setParent

final void setParent(AbstractExpression parent)
Re-parents this Expression to be a child of the given Expression.
Parameters:
parent - The new parent of this object

setText

final void setText(java.lang.String text)
Sets the text of this Expression.
Parameters:
text - The immutable text wrapped by this Expression, which cannot be null

shouldParseWithFactoryFirst

boolean shouldParseWithFactoryFirst()
TODO
Returns:

shouldSkipLiteral

boolean shouldSkipLiteral(AbstractExpression expression)
When parsing an invalid or incomplete query, it is possible two literals would be parsed but in some cases, a CollectionExpression should not be created and the parsing should actually stop here. Example: BETWEEN 10 20, when parsing 20, it should not be parsed as part of the lower bound expression.
Parameters:
expression -
Returns:

toActualText

public java.lang.String toActualText()
Generates a string representation of this StringExpression, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.
Specified by:
toActualText in interface Expression
Specified by:
toActualText in class StringExpression
Returns:
The string representation of this StringExpression

toParsedText

public java.lang.String toParsedText()
Returns a string representation of this StringExpression and its children. The expression should contain whitespace even if the beautified version would not have any. For instance, "SELECT e " should be returned where Expression#toText() would return "SELECT e".
Specified by:
toParsedText in interface Expression
Specified by:
toParsedText in class StringExpression
Returns:
The string representation of this StringExpression

toParsedText

abstract void toParsedText(java.lang.StringBuilder writer,
                           boolean includeVirtual)
Generates a string representation of this Expression.
Parameters:
writer - The buffer used to append this Expression's string representation
includeVirtual - Determines whether to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

updateParsingInfo

private AbstractExpression updateParsingInfo(AbstractExpression expression,
                                             AbstractExpression child,
                                             java.util.List<AbstractExpression> children,
                                             java.util.List<java.lang.Boolean> separatedByCommas,
                                             java.util.List<java.lang.Boolean> separatedBySpaces)

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.