@Retention(value=RUNTIME) @Target(value=ANNOTATION_TYPE) public @interface Platform
InstanceDefault, InstanceOverride,
SingletonDefault and SingletonOverride
and any annotations found annotated with @Platform will then make a
reflective call to the method isGwt(). If the method is missing or returns
false, that annotation is ignored. If an annotation is found, a call is
then made to isDevMode(), which, if present, must match the expected
production mode status.
The jre injector will also check any providers for platform annotations,
except it requires the annotations to provide an isJava() method, which must
return true. The jre injector will also make a reflective call to .version(),
which, if it returns a double, will be matched to the current runtime
environment. Any versions lower than current runtime will be ignored.
This allows library writers to create java 7 or java 8 implementations,
but deliver java 6 (or even java 5) specific implementations.
Java 5 and lower are not supported due to lack of annotation support.
Any platform annotation which supplies a runtimeSelector() method which
returns a Class extends PlatformSelector> will be able to arbitrarily
disable any type using a reflectively instantiated PlatformSelector.
A gwt runtime will receive the StandardGeneratorContext object and TypeOracle
as parameters.
A jre runtime will receive an instance of whatever class the main Injector
interface is bound to as its parameter.public abstract boolean isJava
public abstract boolean isGwt
public abstract boolean isServer
public abstract boolean isMobile
public abstract boolean isDebug
public abstract boolean isDevMode
public abstract Class<? extends PlatformSelector> selector
public abstract Class<? extends Annotation>[] fallback
Copyright © 2012-2013 The Internet Party. All Rights Reserved.