Top Description Inners Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.resolver

public abstract Class ResolverBuilder

extends Object
implements ExpressionVisitor
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.EclipseLinkResolverBuilder, org.eclipse.persistence.jpa.jpql.tools.resolver.DefaultResolverBuilder
Annotations
@SuppressWarnings:nls
Imports
java.sql.Date, .Time, .Timestamp, java.time.LocalDate, .LocalTime, java.util.ArrayList, .List, .Map, org.eclipse.persistence.jpa.jpql.Assert, .ExpressionTools, .LiteralType, org.eclipse.persistence.jpa.jpql.parser.AbsExpression, .AbstractExpressionVisitor, .AbstractPathExpression, .AbstractSchemaName, .AdditionExpression, .AllOrAnyExpression, .AndExpression, .ArithmeticExpression, .ArithmeticFactor, .AvgFunction, .BadExpression, .BetweenExpression, .CaseExpression, .CoalesceExpression, .CollectionExpression, .CollectionMemberDeclaration, .CollectionMemberExpression, .CollectionValuedPathExpression, .ComparisonExpression, .ConcatExpression, .ConstructorExpression, .CountFunction, .DateTime, .DeleteClause, .DeleteStatement, .DivisionExpression, .EmptyCollectionComparisonExpression, .EntityTypeLiteral, .EntryExpression, .ExistsExpression, .Expression, .ExpressionVisitor, .FromClause, .FunctionExpression, .GroupByClause, .HavingClause, .IdentificationVariable, .IdentificationVariableDeclaration, .InExpression, .IndexExpression, .InputParameter, .JPQLExpression, .Join, .KeyExpression, .KeywordExpression, .LengthExpression, .LikeExpression, .LocalDateTime, .LocalExpression, .LocateExpression, .LowerExpression, .MathDoubleExpression, .MathSingleExpression, .MaxFunction, .MinFunction, .ModExpression, .MultiplicationExpression, .NotExpression, .NullComparisonExpression, .NullExpression, .NullIfExpression, .NumericLiteral, .ObjectExpression, .OnClause, .OrExpression, .OrderByClause, .OrderByItem, .RangeVariableDeclaration, .ResultVariable, .SelectClause, .SelectStatement, .SimpleFromClause, .SimpleSelectClause, .SimpleSelectStatement, .SizeExpression, .SqrtExpression, .StateFieldPathExpression, .StringLiteral, .SubExpression, .SubstringExpression, .SubtractionExpression, .SumFunction, .TreatExpression, .TrimExpression, .TypeExpression, .UnknownExpression, .UpdateClause, .UpdateItem, .UpdateStatement, .UpperExpression, .ValueExpression, .WhenClause, .WhereClause, org.eclipse.persistence.jpa.jpql.tools.JPQLQueryContext, org.eclipse.persistence.jpa.jpql.tools.spi.IType

This visitor creates a Resolver that gives information about the visited Expression. The actual Resolver will calculate the proper IType as well.

The type of an Expression follows the following rules:

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Author
Pascal Filion

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
ResolverBuilder.CollectionExpressionVisitor

This visitor is used to check if the expression visited is a CollectionExpression.

Field Summary

Modifier and TypeField and Description
private ResolverBuilder.CollectionExpressionVisitor
collectionExpressionVisitor

This visitor is responsible to retrieve the CollectionExpression if it is visited.

private final JPQLQueryContext
queryContext

The context used to query information about the JPQL query.

protected Resolver
resolver

The Resolver for the Expression that was visited.

Constructor Summary

AccessConstructor and Description
public
ResolverBuilder(JPQLQueryContext
The context used to query information about the JPQL query
queryContext
)

Creates a new ResolverBuilder.

Method Summary

Modifier and TypeMethod and Description
protected Resolver

Returns:

A new Resolver
buildClassNameResolver
(String
The fully qualified class name of the Java type to wrap with a Resolver
typeName
)

Creates a new {link Resolver} that simply wraps the already determined type by using its fully qualified class name.

protected Resolver

Returns:

A new Resolver
buildClassResolver
(Class<?>
The Java type to wrap with a Resolver
type
)

Creates a new {link Resolver} that simply wraps the already determined type.

protected ResolverBuilder.CollectionExpressionVisitor
buildCollectionExpressionVisitor()

Creates a visitor that collects the CollectionExpression if it's been visited.

protected Resolver

Returns:

A new Resolver that can get the information for a collection-valued path
buildCollectionValuedFieldResolver
(String
The last segment of the collection-valued path expression
variableName
)

Creates a new Resolver for the given collection-valued path expression.

protected Resolver

Returns:

The Resolver for an enum literal
buildEnumResolver
(AbstractPathExpression
The Expression that represents the enum literal
expression
,
IType
The IType representing the Enum type
type
,
String
The fully qualified enum constant
enumLiteral
)

Creates a new Resolver that will resolve the given enum literal.

protected Resolver

Returns:

A "null" version of a Resolver
buildNullResolver
()

Creates a new Resolver that is used when nothing can be resolved.

protected Resolver

Returns:

A new Resolver that can get the information for a state field path
buildStateFieldResolver
(String
The last segment of the state field path expression
variableName
)

Creates a new Resolver for the given state field path expression.

public void
dispose()

Disposes the internal data of this resolver.

protected CollectionExpression

Returns:

The given Expression if it is a CollectionExpression or null if it is any other object
getCollectionExpression
(Expression
The Expression to cast
expression
)

Casts the given Expression to a CollectionExpression if it is actually an object of that type.

protected ResolverBuilder.CollectionExpressionVisitor
getCollectionExpressionVisitor()

Returns the visitor that collects the CollectionExpression if it's been visited.

protected DeclarationResolver

Returns:

The DeclarationResolver for the current query being visited
getDeclarationResolver
()

Returns the DeclarationResolver of the current query's declaration.

protected DeclarationResolver

Returns:

The DeclarationResolver for the current query being visited
getDeclarationResolver
(Expression
The Expression that will be used to retrieve its query expression, i.e. either JPQLExpression or SimpleSelectStatement
expression
)

Returns the DeclarationResolver of the current query's declaration.

protected JPQLQueryContext

Returns:

The JPQLQueryContext, which is never null
getQueryContext
()

Returns the JPQLQueryContext that contains information related to the JPQL query.

public Resolver

Returns:

The current Resolver, which should never be null
getResolver
()

Returns the current Resolver used to resolve an Expression.

public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
visit(DateTime
The Expression to visit
expression
)

Implements org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor.visit.

Visits the DateTime expression.
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
visit(Join
The Expression to visit
expression
)

Implements org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor.visit.

Visits the Join expression.
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
visit(OnClause
The Expression to visit
expression
)

Implements org.eclipse.persistence.jpa.jpql.parser.ExpressionVisitor.visit.

Visits the OnClause expression.
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
protected void
visitArithmeticExpression(ArithmeticExpression expression)

Visits the given ArithmeticExpression and create the appropriate Resolver.

protected void
visitCollectionEquivalentExpression(Expression
The Expression to calculate the type of its children
expression
,
Expression
This Expression will be resolved, if it's not null and its type will be added to the collection of types
extraExpression
)

Visits the given Expression and creates a Resolver that will check the type for each of its children.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait