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 java.lang.String |
ADDON_PROCESSOR_FILE_EXTENSION
Addon Processor file extension.
|
static java.lang.String |
ADDON_PROCESSOR_IVY_CONF
The name of the Ivy configuration to use to declare addon processors.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<Marker> |
execute(AddonProcessor.ExecutionKind kind,
JavaProject project,
java.util.List<Delta> deltas,
java.io.File outputFolder)
Runs this processor.
|
java.io.FilenameFilter |
getDeltaFilter(JavaProject project)
Given project information, gets a filter to evict project deltas that are not needed by this processor.
|
java.lang.String |
getId()
Gets the ID of this processor.
|
FolderKind |
getPreferredOutputFolderKind()
Gets the preferred output folder kind of this processor.
|
static final java.lang.String ADDON_PROCESSOR_IVY_CONF
static final java.lang.String ADDON_PROCESSOR_FILE_EXTENSION
java.lang.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
java.io.FilenameFilter getDeltaFilter(JavaProject project)
project
- Java project information the filter can rely on.java.util.List<Marker> execute(AddonProcessor.ExecutionKind kind, JavaProject project, java.util.List<Delta> deltas, java.io.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.