Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Java 17 is now generally available.

Class DatastoreCallbacksProcessor (2.0.0)

Stay organized with collections Save and categorize content based on your preferences.
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

Inheritance

java.lang.Object > AbstractProcessor > DatastoreCallbacksProcessor

Constructors

DatastoreCallbacksProcessor()

public DatastoreCallbacksProcessor()

Methods

getSupportedSourceVersion()

public SourceVersion getSupportedSourceVersion()
Returns
TypeDescription
SourceVersion
Overrides

process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)

public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
Parameters
NameDescription
annotationsSet<? extends javax.lang.model.element.TypeElement>
roundEnvRoundEnvironment
Returns
TypeDescription
boolean
Overrides