@Documented
@Target(value={})
@Retention(value=CLASS)
public @interface Dependency
This is handy in the case that you want to use gwt reflection on a type that you cannot annotate without maintaining duplicate copies on your own classpath (ick!).
Simply add this annotation to your @GwtRetention declaration,
then whenever that type is included with GwtReflect.magicClass(Class),
then so will the declared members.
This will allow you to use Class.forName(""), and simply catch the missing
class exception if the type actually isn't on the classpath, provided
you set optional() to true. By default, a missing dependency
on the gwt module classpath will cause the compiler to throw an error.
This can be used to perform "feature sniffing" on the gwt classpath.
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?>[] |
classes
A specific array of classes to retain.
|
java.lang.String |
className
A specific class to retain.
|
Dependency.Member[] |
members
A filter to reduce the members retained.
|
boolean |
optional
Whether or not the declared dependency is optional.
|
java.lang.String |
packageName
A package name to retain.
|
public abstract java.lang.String packageName
This value is optional, and it's retention level can be further
restricted to a single class, by use of the className() method.
If className is not a fully qualified name, packageName() cannot be left empty.
public abstract java.lang.String className
This value is optional, and it may either contain a fully qualified class name (Class.getCanonicalName()), or used in conjunction with packageName() to form a fully qualified name.
The annotation processor using this annotation will have to do some classpath guessing in order to find the type you wish to keep.
public abstract java.lang.Class<?>[] classes
This value is strictly optional, and does not have to match the package name specified (if any).
If none of packageName(), className() or classes()
are specified, the annotation processor may emit a warning or throw an error.
public abstract Dependency.Member[] members
The default value of an empty array equates to "apply to all".
If more than one class is specified, the filter applies to them all.