public class DatastoreCallbacksProcessor extends AbstractProcessor
Processes datastore callback annotations (
PrePut, PostPut, PreDelete, PostDelete,
PreGet, com.google.appengine.api.datastore.PostLoad, PreQuery) and
generates a config file that the Datastore API can load at runtime. Each
line of the config file is of the format:
kind.callback_type=comma-separated list of methods
where 'kind' is the kind of the entity to which the config on that line
applies, 'callback_type' is one of PrePut, PostPut, PreDelete, PostDelete,
and each entry in the comma-separated list of methods is a colon-delimited
fully-qualified classname:method name tuple. So for example, if the dev
wants a method named 'prePutCallback1' belonging to class
'com.example.MyCallbacks and a method named 'prePutCallback2'
belonging to the same class to be invoked before any entity of kind 'yar' is
put, the config file will look like this:
yar.PrePut=com.example.MyCallbacks:prePutCallback1,com.example.MyCallbacks:prePutCallback2
Note that it is possible to have a line which refers to all kinds by omitting the kind name:
.PreDelete=com.example.MyCallbacks:preDeleteCallback1
Each type of callback has its own signature requirements for the methods it annotates. If any of these signature requirements are violated the processor will produce an error. See the javadoc for the annotations for more information about the callback-specific signature requirements.
Processor Options:
- debug - turns on debug statements
Constructors
DatastoreCallbacksProcessor()
public DatastoreCallbacksProcessor()
Methods
getSupportedSourceVersion()
public SourceVersion getSupportedSourceVersion()
Returns | |
---|---|
Type | Description |
SourceVersion |
process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
Parameters | |
---|---|
Name | Description |
annotations |
Set<? extends javax.lang.model.element.TypeElement> |
roundEnv |
RoundEnvironment |
Returns | |
---|---|
Type | Description |
boolean |