Klasse ReconcileContext
A reconcile participant can get the AST for the reconcile-operation using
getAST4()
. If the participant modifies in any way the AST
(either by modifying the source of the working copy, or modifying another entity
that would result in different bindings for the AST), it is expected to reset the
AST in the context using resetAST()
.
A reconcile participant can also create and return problems using
putProblems(String, CategorizedProblem[])
. These problems are then reported
to the problem requestor of the reconcile operation.
- Seit:
- 3.2
- Siehe auch:
-
Konstruktorübersicht
KonstruktorBeschreibungReconcileContext
(ReconcileWorkingCopyOperation operation, CompilationUnit workingCopy) Creates a reconcile context for the given reconcile operation. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunggetAST
(int level) Returns a resolved AST with the given AST level.getAST3()
Veraltet.JLS3 has been deprecated.getAST4()
Veraltet.JLS4 has been deprecated.getAST8()
Veraltet.JLS8 has been deprecated.int
Returns the AST level requested by the reconcile operation.getDelta()
Returns the delta describing the change to the working copy being reconciled.getProblems
(String markerType) Returns the problems to be reported to the problem requestor of the reconcile operation for the given marker type.int
Returns the reconcile flag of this context.Returns the working copy this context refers to.boolean
Returns whether the reconcile operation is resolving bindings.void
putProblems
(String markerType, CategorizedProblem[] problems) Sets the problems to be reported to the problem requestor of the reconcile operation for the given marker type.void
resetAST()
Resets the AST carried by this context.
-
Konstruktordetails
-
ReconcileContext
Creates a reconcile context for the given reconcile operation.- Parameter:
operation
- the reconcile operation
-
-
Methodendetails
-
getAST3
Veraltet.JLS3 has been deprecated. This method has been replaced bygetAST4()
which returns an AST with JLS4 level.Returns a resolved AST withJLS3
level. It is created from the current state of the working copy. Creates one if none exists yet. Returnsnull
if the current state of the working copy doesn't allow the AST to be created (e.g. if the working copy's content cannot be parsed).If the AST level requested during reconciling is not
AST.JLS3
or if binding resolutions was not requested, then a different AST is created. Note that this AST does not become the current AST and it is only valid for the requestor.- Gibt zurück:
- the AST created from the current state of the working copy,
or
null
if none could be created - Löst aus:
JavaModelException
- if the contents of the working copy cannot be accessed. Reasons include:- The working copy does not exist (ELEMENT_DOES_NOT_EXIST)
-
getAST4
Veraltet.JLS4 has been deprecated. This method has been replaced bygetAST8()
which returns an AST with JLS8 level.Returns a resolved AST withJLS4
level. It is created from the current state of the working copy. Creates one if none exists yet. Returnsnull
if the current state of the working copy doesn't allow the AST to be created (e.g. if the working copy's content cannot be parsed).If the AST level requested during reconciling is not
AST.JLS4
or if binding resolutions was not requested, then a different AST is created. Note that this AST does not become the current AST and it is only valid for the requestor.- Gibt zurück:
- the AST created from the current state of the working copy,
or
null
if none could be created - Löst aus:
JavaModelException
- if the contents of the working copy cannot be accessed. Reasons include:- The working copy does not exist (ELEMENT_DOES_NOT_EXIST)
- Seit:
- 3.7.1
-
getAST8
Veraltet.JLS8 has been deprecated. This method has been replaced bygetAST(int)
which returns an AST with the given level.Returns a resolved AST withJLS8
level. It is created from the current state of the working copy. Creates one if none exists yet. Returnsnull
if the current state of the working copy doesn't allow the AST to be created (e.g. if the working copy's content cannot be parsed).If the AST level requested during reconciling is not
AST.JLS8
or if binding resolutions was not requested, then a different AST is created. Note that this AST does not become the current AST and it is only valid for the requestor.- Gibt zurück:
- the AST created from the current state of the working copy,
or
null
if none could be created - Löst aus:
JavaModelException
- if the contents of the working copy cannot be accessed. Reasons include:- The working copy does not exist (ELEMENT_DOES_NOT_EXIST)
- Seit:
- 3.10
-
getAST
Returns a resolved AST with the given AST level. It is created from the current state of the working copy. Creates one if none exists yet. Returnsnull
if the current state of the working copy doesn't allow the AST to be created (e.g. if the working copy's content cannot be parsed).If the AST level requested during reconciling is not the latest available AST level or if binding resolutions was not requested, then a different AST is created. Note that this AST does not become the current AST and it is only valid for the requestor.
- Parameter:
level
- the API level; one of the.JLS*
level constants declared onAST
- Gibt zurück:
- the AST created from the current state of the working copy,
or
null
if none could be created - Löst aus:
JavaModelException
- if the contents of the working copy cannot be accessed. Reasons include:- The working copy does not exist (ELEMENT_DOES_NOT_EXIST)
- Seit:
- 3.14
-
getASTLevel
public int getASTLevel()Returns the AST level requested by the reconcile operation. It is eitherICompilationUnit.NO_AST
, or one of the JLS constants defined onAST
.- Gibt zurück:
- the AST level requested by the reconcile operation
-
isResolvingBindings
public boolean isResolvingBindings()Returns whether the reconcile operation is resolving bindings.- Gibt zurück:
- whether the reconcile operation is resolving bindings
-
getReconcileFlags
public int getReconcileFlags()Returns the reconcile flag of this context. This flag is a bitwise value of the constant defined inICompilationUnit
.- Gibt zurück:
- the reconcile flag of this context
- Seit:
- 3.6
- Siehe auch:
-
getDelta
Returns the delta describing the change to the working copy being reconciled. Returnsnull
if there is no change. Note that the delta's AST is not yet positioned at this stage. UsegetAST4()
to get the current AST.- Gibt zurück:
- the delta describing the change, or
null
if none
-
getProblems
Returns the problems to be reported to the problem requestor of the reconcile operation for the given marker type. Returnsnull
if no problems need to be reported for this marker type.- Parameter:
markerType
- the given marker type- Gibt zurück:
- problems to be reported to the problem requestor
-
getWorkingCopy
Returns the working copy this context refers to.- Gibt zurück:
- the working copy this context refers to
-
resetAST
public void resetAST()Resets the AST carried by this context. A compilation participant that modifies the environment that would result in different bindings for the AST is expected to reset the AST on this context, so that other participants don't get a stale AST.Note that resetting the AST will not restart the reconcile process. Only further participants will see the new AST. Thus participants running before the one that resets the AST will have a stale view of the AST and its problems. Use the compilation participant extension point to order the participants.
-
putProblems
Sets the problems to be reported to the problem requestor of the reconcile operation for the given marker type.null
indicates that no problems need to be reported.Using this functionality, a participant that resolves problems for a given marker type can hide those problems since they don't exist any longer.
- Parameter:
markerType
- the marker type of the given problemsproblems
- the problems to be reported to the problem requestor of the reconcile operation, ornull
if none
-