Class AbstractRefactoringTool
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.AbstractRefactoringTool
-
- Direct Known Subclasses:
BasicRefactoringTool,RefactoringTool
public abstract class AbstractRefactoringTool extends java.lang.ObjectThe abstract definition of a refactoring- Version:
- 2.4
- See Also:
RefactoringTool,BasicRefactoringTool- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRefactoringTool(java.lang.CharSequence jpqlFragment, IManagedTypeProvider managedTypeProvider, java.lang.String jpqlQueryBNFId)Creates a newBasicRefactoringTool.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.CharSequencegetJPQLFragment()Returns the original JPQL query or the JPQL fragment that was passed to this tool so it can be manipulated.java.lang.StringgetJPQLQueryBNFId()Returns the unique identifier of the JPQL query BNF that determined how the JPQL query or fragment needs to be parsed.IManagedTypeProvidergetManagedTypeProvider()Returns the provider of managed types.booleanisTolerant()Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries.voidsetTolerant(boolean tolerant)Sets whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries.abstract java.lang.StringtoActualText()Returns the resulted of the refactoring operations.
-
-
-
Constructor Detail
-
AbstractRefactoringTool
protected AbstractRefactoringTool(java.lang.CharSequence jpqlFragment, IManagedTypeProvider managedTypeProvider, java.lang.String jpqlQueryBNFId)Creates a newBasicRefactoringTool.- Parameters:
jpqlFragment- The JPQL query to manipulate or a single JPQL fragment, which is parsed using the JPQL query BNF identifier by the given IDmanagedTypeProvider- The external form of a provider that gives access to the JPA metadatajpqlQueryBNFId- The unique identifier of theJPQLQueryBNFthat determines how to parse the JPQL fragment
-
-
Method Detail
-
getJPQLFragment
public java.lang.CharSequence getJPQLFragment()
Returns the original JPQL query or the JPQL fragment that was passed to this tool so it can be manipulated.- Returns:
- The string representation of the JPQL query or fragment
-
getJPQLQueryBNFId
public java.lang.String getJPQLQueryBNFId()
Returns the unique identifier of the JPQL query BNF that determined how the JPQL query or fragment needs to be parsed.- Returns:
- The ID of the
JPQLQueryBNFused to parse the query
-
getManagedTypeProvider
public IManagedTypeProvider getManagedTypeProvider()
Returns the provider of managed types.- Returns:
- The provider that gives access to the managed types
-
isTolerant
public boolean isTolerant()
Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries.- Returns:
- By default, the parsing system uses tolerance
-
setTolerant
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-trueif the JPQL query or fragment should be parsed with tolerance;falseotherwise
-
toActualText
public abstract java.lang.String toActualText()
Returns the resulted of the refactoring operations. The list of changes will be removed after applying the changes.- Returns:
- The string representation of the JPQL query that contains the changes
-
-