@Retention(value=SOURCE) @Target(value=METHOD) public @interface OnLocation
stoprequests for obtaining current location of the application/device/user. Put the
OnLocationannotation 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
callMeWhenYouKnowWhereYouArea package private class
CallMeWhenYouKnowWhereYouAreHandlewill be generated in the same package. One can use its
createWatchstatic method to get one time/repeated time instance of a
handle. After configuring the
handlevia its setter methods, one can
startthe 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
handleclass 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
Exceptionparameter. If this method is not specified, the exception is just printed to console.
Copyright © 2021 The Apache Software Foundation. All rights reserved.