Back to project page roboject.
The source code is released under:
Apache License
If you think the Android project roboject listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.akquinet.android.roboject.injectors; /* ww w . ja va 2 s.co m*/ import java.lang.annotation.Annotation; public abstract class ClassInjector<A extends Annotation, T> implements Injector { protected final Class<A> annotationType; protected final T managed; protected ClassInjector(T managed, Class<A> annotationType) { this.annotationType = annotationType; this.managed = managed; } @Override public final void inject() { A annotation = managed.getClass().getAnnotation(annotationType); if (annotation != null) { handleAnnotation(annotation); } } protected abstract void handleAnnotation(A annotation); }