-
- All Known Implementing Classes:
AssertResourceExists
public interface Handler
Processes resources from the class path. Implementations MUST:- Be public
- Have a public no-args constructor
- Be available as compiled types on the compiler classpath
Processor
. That is:- The result of processing a given input is not a function of the presence or absence of other inputs (orthogonality)
- Processing the same input produces the same output (consistency)
- Processing input A followed by processing input B is equivalent to processing B then A (commutativity)
- Processing an input does not rely on the presence of the output of other annotation processors (independence)
- See Also:
ResourceFiles.handler()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Set<ConfigDef>
config()
The configuration supported by this handler.void
handle(Context context)
Handles the context resources.default boolean
validConfig(List<Config> config, Consumer<String> errorReporter)
Validates theContext.config()
.
-
-
-
Method Detail
-
handle
void handle(Context context) throws Exception
Handles the context resources.- Parameters:
context
- processing context- Throws:
Exception
- any exception- See Also:
Context.resources()
-
config
default Set<ConfigDef> config()
The configuration supported by this handler.- Returns:
- empty set by default
-
validConfig
default boolean validConfig(List<Config> config, Consumer<String> errorReporter)
Validates the
Context.config()
. Override to change behaviour.The default implementation returns true if:
- Key names are unique
- Key names match
config()
ConfigDef.key()
- Values pass
config()
ConfigDef.isValid(String)
- Parameters:
config
- handler configurationerrorReporter
- error message consumer- Returns:
- true if the config is valid for this handler
-
-