Class AnnotationProcessor
- java.lang.Object
-
- org.hotswap.agent.annotation.handler.AnnotationProcessor
-
public class AnnotationProcessor extends Object
Process annotations on a plugin, register appropriate handlers.- Author:
- Jiri Bubnik
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Class<? extends Annotation>,PluginHandler>handlersprotected PluginManagerpluginManager
-
Constructor Summary
Constructors Constructor Description AnnotationProcessor(PluginManager pluginManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotationHandler(Class<? extends Annotation> annotation, PluginHandler handler)voidinit(PluginManager pluginManager)booleanprocessAnnotations(Class processClass, Class pluginClass)Process annotations on the plugin class - only static methods, methods to hook plugin initialization.booleanprocessAnnotations(Object plugin)Process annotations on a plugin - non static fields and methods.
-
-
-
Field Detail
-
pluginManager
protected PluginManager pluginManager
-
handlers
protected Map<Class<? extends Annotation>,PluginHandler> handlers
-
-
Constructor Detail
-
AnnotationProcessor
public AnnotationProcessor(PluginManager pluginManager)
-
-
Method Detail
-
init
public void init(PluginManager pluginManager)
-
addAnnotationHandler
public void addAnnotationHandler(Class<? extends Annotation> annotation, PluginHandler handler)
-
processAnnotations
public boolean processAnnotations(Class processClass, Class pluginClass)
Process annotations on the plugin class - only static methods, methods to hook plugin initialization.- Parameters:
processClass- class to process annotationpluginClass- main plugin class (annotated with @Plugin)- Returns:
- true if success
-
processAnnotations
public boolean processAnnotations(Object plugin)
Process annotations on a plugin - non static fields and methods.- Parameters:
plugin- plugin object- Returns:
- true if success
-
-