public interface AddonProcessor
Since there is no guarantee that processor caller will create an instance per project or a unique instance of a processor for all projects, processors must be stateless, thus only rely on given information and deltas.
Delta
,
Marker
,
JavaProject
Modifier and Type | Interface and Description |
---|---|
static class |
AddonProcessor.ExecutionKind
An enumeration of possible kind of processor execution.
|
Modifier and Type | Field and Description |
---|---|
static String |
ADDON_PROCESSOR_FILE_EXTENSION
Addon Processor file extension.
|
static String |
ADDON_PROCESSOR_IVY_CONF
The name of the Ivy configuration to use to declare addon processors.
|
Modifier and Type | Method and Description |
---|---|
List<Marker> |
execute(AddonProcessor.ExecutionKind kind,
JavaProject project,
List<Delta> deltas,
File outputFolder)
Runs this processor.
|
FilenameFilter |
getDeltaFilter(JavaProject project)
Given project information, gets a filter to evict project deltas that are not needed by this processor.
|
String |
getId()
Gets the ID of this processor.
|
FolderKind |
getPreferredOutputFolderKind()
Gets the preferred output folder kind of this processor.
|
static final String ADDON_PROCESSOR_FILE_EXTENSION
static final String ADDON_PROCESSOR_IVY_CONF
List<Marker> execute(AddonProcessor.ExecutionKind kind, JavaProject project, List<Delta> deltas, File outputFolder)
Note that deltas list cannot be empty nor null
, and all of them match this processor delta filter.
Furthermore, the given output folder respects the semantics of getPreferredOutputFolderKind()
.
kind
- the kind of execution.project
- Java project information to rely on.deltas
- list of project deltas.outputFolder
- the output folder for generated files.FilenameFilter getDeltaFilter(JavaProject project)
project
- Java project information the filter can rely on.String getId()
IDs are used to create output source folders. Thus, they must not contain space or special characters.
FolderKind getPreferredOutputFolderKind()
Note that FolderKind.Project
is not a valid preferred output folder. If this value is returned, an
exception will be thrown, thus processor will not be run.
In addition, if this method returns null
, executors will automatically use Java main source folder as
preferred output kind.
FolderKind