public @interface OnLocation
stop requests for obtaining current
location of the application/device/user. Put the
on top of a (non-private) method in your class which takes one argument
Position. Based on name of your method (unless a class name is
directly specified via
OnLocation.className() attribute) a handle class is
generated. For example if your method name is
a package private class
be generated in the same package. One can use its
createWatch static method to get one time/repeated time
instance of a
handle. After configuring the
handle via its setter methods, one can
start the location request.
In case something goes wrong a method in the same class named
can be specified (should take one
The overall behavior of the system mimics W3C's Geolocation API.
public abstract java.lang.String className
handle class to generate. By
default the name is derived from the name of annotated method by
capitalizing the first character and appending
The generated class contains two static methods:
createWatch which take no parameters if this method
is static or one parameter (of this class) if this method is instance
one. Both static methods return
public abstract java.lang.String onError
parameter. If this method is not specified, the exception is just
printed to console.
Copyright © 2021 The Apache Software Foundation. All rights reserved.