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

public abstract Class AbstractRefactoringTool

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.BasicRefactoringTool, org.eclipse.persistence.jpa.jpql.tools.RefactoringTool
Imports
org.eclipse.persistence.jpa.jpql.tools.spi.IManagedTypeProvider

The abstract definition of a refactoring
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
RefactoringTool, BasicRefactoringTool

Field Summary

Modifier and TypeField and Description
private CharSequence
jpqlFragment

The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query specified BNF.

private String
jpqlQueryBNFId

The unique identifier of the JPQLQueryBNF that determines how to parse the JPQL fragment.

private IManagedTypeProvider
managedTypeProvider

The external form of a provider that gives access to the JPA metadata.

private boolean
tolerant

Determines whether the parsing system should be tolerant.

Constructor Summary

AccessConstructor and Description
protected
AbstractRefactoringTool(CharSequence
The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query BNF identifier by the given ID
jpqlFragment
,
IManagedTypeProvider
The external form of a provider that gives access to the JPA metadata
managedTypeProvider
,
String
The unique identifier of the JPQLQueryBNF that determines how to parse the JPQL fragment
jpqlQueryBNFId
)

Creates a new BasicRefactoringTool.

Method Summary

Modifier and TypeMethod and Description
public CharSequence

Returns:

The string representation of the JPQL query or fragment
getJPQLFragment
()

Returns the original JPQL query or the JPQL fragment that was passed to this tool so it can be manipulated.

public String

Returns:

The ID of the JPQLQueryBNF used to parse the query
getJPQLQueryBNFId
()

Returns the unique identifier of the JPQL query BNF that determined how the JPQL query or fragment needs to be parsed.

public IManagedTypeProvider

Returns:

The provider that gives access to the managed types
getManagedTypeProvider
()

Returns the provider of managed types.

public boolean

Returns:

By default, the parsing system uses tolerance
isTolerant
()

Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries.

public void
setTolerant(boolean
true if the JPQL query or fragment should be parsed with tolerance; false otherwise
tolerant
)

Sets whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries.

public abstract String

Returns:

The string representation of the JPQL query that contains the changes
toActualText
()

Returns the resulted of the refactoring operations.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jpqlFragmentback to summary
private CharSequence jpqlFragment

The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query specified BNF.

jpqlQueryBNFIdback to summary
private String jpqlQueryBNFId

The unique identifier of the JPQLQueryBNF that determines how to parse the JPQL fragment.

managedTypeProviderback to summary
private IManagedTypeProvider managedTypeProvider

The external form of a provider that gives access to the JPA metadata.

tolerantback to summary
private boolean tolerant

Determines whether the parsing system should be tolerant.

Constructor Detail

AbstractRefactoringToolback to summary
protected AbstractRefactoringTool(CharSequence jpqlFragment, IManagedTypeProvider managedTypeProvider, String jpqlQueryBNFId)

Creates a new BasicRefactoringTool.

Parameters
jpqlFragment:CharSequence

The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query BNF identifier by the given ID

managedTypeProvider:IManagedTypeProvider

The external form of a provider that gives access to the JPA metadata

jpqlQueryBNFId:String

The unique identifier of the JPQLQueryBNF that determines how to parse the JPQL fragment

Method Detail

getJPQLFragmentback to summary
public CharSequence getJPQLFragment()

Returns the original JPQL query or the JPQL fragment that was passed to this tool so it can be manipulated.

Returns:CharSequence

The string representation of the JPQL query or fragment

getJPQLQueryBNFIdback to summary
public String getJPQLQueryBNFId()

Returns the unique identifier of the JPQL query BNF that determined how the JPQL query or fragment needs to be parsed.

Returns:String

The ID of the JPQLQueryBNF used to parse the query

getManagedTypeProviderback to summary
public IManagedTypeProvider getManagedTypeProvider()

Returns the provider of managed types.

Returns:IManagedTypeProvider

The provider that gives access to the managed types

isTolerantback to summary
public boolean isTolerant()

Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries.

Returns:boolean

By default, the parsing system uses tolerance

setTolerantback to summary
public void setTolerant(boolean tolerant)

Sets whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries.

Parameters
tolerant:boolean

true if the JPQL query or fragment should be parsed with tolerance; false otherwise

toActualTextback to summary
public abstract String toActualText()

Returns the resulted of the refactoring operations. The list of changes will be removed after applying the changes.

Returns:String

The string representation of the JPQL query that contains the changes