Class DatastoreCallbacksProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- com.google.appengine.tools.compilation.DatastoreCallbacksProcessor
-
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes({"com.google.appengine.api.datastore.PrePut","com.google.appengine.api.datastore.PostPut","com.google.appengine.api.datastore.PreDelete","com.google.appengine.api.datastore.PostDelete","com.google.appengine.api.datastore.PreGet","com.google.appengine.api.datastore.PostLoad","com.google.appengine.api.datastore.PreQuery"}) @SupportedOptions("debug") public class DatastoreCallbacksProcessor extends AbstractProcessor
Processes datastore callback annotations (PrePut
,PostPut
,PreDelete
,PostDelete
,PreGet
,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
.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
-
-
Constructor Summary
Constructors Constructor Description DatastoreCallbacksProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SourceVersion
getSupportedSourceVersion()
boolean
process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
-
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, init
-
-
-
-
Method Detail
-
getSupportedSourceVersion
public SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersion
in interfaceProcessor
- Overrides:
getSupportedSourceVersion
in classAbstractProcessor
-
process
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
- Specified by:
process
in interfaceProcessor
- Specified by:
process
in classAbstractProcessor
-
-