org.eclipse.wst.jsdt.core.compiler
Class ValidationParticipant

java.lang.Object
  extended by org.eclipse.wst.jsdt.core.compiler.ValidationParticipant

public abstract class ValidationParticipant
extends java.lang.Object

A validation participant is notified of events occuring during the validation process. The notified events are the result of a build action, a clean action, a reconcile operation (for a working copy), etc.

Clients wishing to participate in the validation process must subclass this class, and implement isActive(IJavaScriptProject), aboutToBuild(IJavaScriptProject), reconcile(ReconcileContext), etc.

This class is intended to be subclassed by clients.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made 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.


Field Summary
static int NEEDS_FULL_BUILD
           
static int READY_FOR_BUILD
           
 
Constructor Summary
ValidationParticipant()
           
 
Method Summary
 int aboutToBuild(IJavaScriptProject project)
          Notifies this participant that a validation is about to start and provides it the opportunity to create missing source folders for generated source files.
 void buildStarting(BuildContext[] files, boolean isBatch)
          Notifies this participant that a validation operation is about to start and provides it the opportunity to generate source files based on the source files about to be validated.
 void cleanStarting(IJavaScriptProject project)
          Notifies this participant that a clean is about to start and provides it the opportunity to delete generated source files.
 boolean isActive(IJavaScriptProject project)
          Returns whether this participant is active for a given project.
 boolean isAnnotationProcessor()
           
 void processAnnotations(BuildContext[] files)
           
 void reconcile(ReconcileContext context)
          Notifies this participant that a reconcile operation is happening.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READY_FOR_BUILD

public static int READY_FOR_BUILD

NEEDS_FULL_BUILD

public static int NEEDS_FULL_BUILD
Constructor Detail

ValidationParticipant

public ValidationParticipant()
Method Detail

aboutToBuild

public int aboutToBuild(IJavaScriptProject project)
Notifies this participant that a validation is about to start and provides it the opportunity to create missing source folders for generated source files. Additional source folders should be marked as optional so the project can be built when the folders do not exist. Only sent to participants interested in the project.

Default is to return READY_FOR_BUILD.

Parameters:
project - the project about to build
Returns:
READY_FOR_BUILD or NEEDS_FULL_BUILD

buildStarting

public void buildStarting(BuildContext[] files,
                          boolean isBatch)
Notifies this participant that a validation operation is about to start and provides it the opportunity to generate source files based on the source files about to be validated. When isBatchBuild is true, then files contains all source files in the project. Only sent to participants interested in the current build project.

Parameters:
files - is an array of BuildContext
isBatch - identifies when the build is a batch build

cleanStarting

public void cleanStarting(IJavaScriptProject project)
Notifies this participant that a clean is about to start and provides it the opportunity to delete generated source files. Only sent to participants interested in the project.

Parameters:
project - the project about to be cleaned

isActive

public boolean isActive(IJavaScriptProject project)
Returns whether this participant is active for a given project.

Default is to return false.

For efficiency, participants that are not interested in the given project should return false for that project.

Parameters:
project - the project to participate in
Returns:
whether this participant is active for a given project

isAnnotationProcessor

public boolean isAnnotationProcessor()

processAnnotations

public void processAnnotations(BuildContext[] files)

reconcile

public void reconcile(ReconcileContext context)
Notifies this participant that a reconcile operation is happening. The participant can act on this reconcile operation by using the given context. Other participant can then see the result of this participation on this context.

Note that a participant should not modify the buffer of the working copy that is being reconciled.

Default is to do nothing.

Parameters:
context - the reconcile context to act on