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

public abstract Class AbstractPathResolver

extends Resolver
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.resolver.CollectionValuedFieldResolver, org.eclipse.persistence.jpa.jpql.tools.resolver.StateFieldResolver
Imports
org.eclipse.persistence.jpa.jpql.tools.spi.IManagedType, .IMapping, .ITypeDeclaration

This Resolver is responsible to resolve a single path of a path expression (state field path expression, singled valued object field, or a collection-valued path expression).
Author
Pascal Filion
Since
2.3
Version
2.5
See Also
CollectionValuedFieldResolver, StateFieldResolver

Field Summary

Modifier and TypeField and Description
private IManagedType
managedType

The IManagedType representing this single valued object field path.

private boolean
managedTypeResolved

This flag is used to prevent resolving the IManagedType more than once and no managed type could be found the first time.

private IMapping
mapping

The mapping of the last path of the path expression or null if it could not be found.

private boolean
mappingResolved

This flag is used to prevent resolving the IMapping more than once and no mapping could be found the first time.

protected final String
path

The name of the path for which its type will be retrieved.

Constructor Summary

AccessConstructor and Description
protected
AbstractPathResolver(Resolver
The parent Resolver, which is never null
parent
,
String
The name of the path
path
)

Creates a new AbstractPathResolver.

Method Summary

Modifier and TypeMethod and Description
protected ITypeDeclaration
public IManagedType
getManagedType()

Overrides org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.getManagedType.

Returns the IManagedType associated with the field handled by this Resolver.
public final IMapping
public final String

Returns:

The single path represented by this Resolver
getPath
()

Returns the single path represented by this Resolver.

protected abstract IManagedType

Returns:

The IManagedType for the given IMapping, if it has one; null if the type is a primitive
resolveManagedType
(IMapping
The IMapping, which is never null, is used to calculate the IManagedType
mapping
)

Resolves this path's IManagedType by using the given IMapping.

protected IMapping

Returns:

Either the IMapping or null if none exists
resolveMapping
()

Retrieves the IMapping for the given property name.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver:
addChildbuildTypecheckParentgetChildgetParentgetParentManagedTypegetParentMappinggetParentTypegetParentTypeDeclarationgetProvidergetQuerygetTypegetTypegetTypegetTypeDeclarationgetTypeHelpergetTypeRepositoryisNullAllowedsetNullAllowed

Field Detail

managedTypeback to summary
private IManagedType managedType

The IManagedType representing this single valued object field path.

managedTypeResolvedback to summary
private boolean managedTypeResolved

This flag is used to prevent resolving the IManagedType more than once and no managed type could be found the first time.

mappingback to summary
private IMapping mapping

The mapping of the last path of the path expression or null if it could not be found.

mappingResolvedback to summary
private boolean mappingResolved

This flag is used to prevent resolving the IMapping more than once and no mapping could be found the first time.

pathback to summary
protected final String path

The name of the path for which its type will be retrieved.

Constructor Detail

AbstractPathResolverback to summary
protected AbstractPathResolver(Resolver parent, String path)

Creates a new AbstractPathResolver.

Parameters
parent:Resolver

The parent Resolver, which is never null

path:String

The name of the path

Method Detail

buildTypeDeclarationback to summary
protected ITypeDeclaration buildTypeDeclaration()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.buildTypeDeclaration.

Doc from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.buildTypeDeclaration.

Resolves the ITypeDeclaration of the property handled by this Resolver.

Returns:ITypeDeclaration

Either the ITypeDeclaration that was resolved by this Resolver or the ITypeDeclaration for IType#UNRESOLVABLE_TYPE if it could not be resolved

Annotations
@Override
getManagedTypeback to summary
public IManagedType getManagedType()

Overrides org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.getManagedType.

Doc from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.getManagedType.

Returns the IManagedType associated with the field handled by this Resolver. If this Resolver does not handle a field that has a IManagedType, then null should be returned.

For example: "SELECT e FROM Employee e", the Resolver for e would be returning the IManagedType for Employee.

Returns:IManagedType

Either the IManagedType, if it could be resolved; null otherwise

Annotations
@Override
getMappingback to summary
public final IMapping getMapping()

Overrides org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.getMapping.

Doc from org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver.getMapping.

Returns the IMapping for the wrapped field.

Returns:IMapping

Either the IMapping or null if none exists

Annotations
@Override
getPathback to summary
public final String getPath()

Returns the single path represented by this Resolver.

Returns:String

The single path represented by this Resolver

resolveManagedTypeback to summary
protected abstract IManagedType resolveManagedType(IMapping mapping)

Resolves this path's IManagedType by using the given IMapping.

Parameters
mapping:IMapping

The IMapping, which is never null, is used to calculate the IManagedType

Returns:IManagedType

The IManagedType for the given IMapping, if it has one; null if the type is a primitive

resolveMappingback to summary
protected IMapping resolveMapping()

Retrieves the IMapping for the given property name.

Returns:IMapping

Either the IMapping or null if none exists

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override