org.jboss.deployers.plugins.annotations
Class GenericAnnotationResourceVisitor

java.lang.Object
  extended by org.jboss.deployers.plugins.annotations.GenericAnnotationResourceVisitor
All Implemented Interfaces:
org.jboss.classloading.spi.visitor.ResourceVisitor

public class GenericAnnotationResourceVisitor
extends Object
implements org.jboss.classloading.spi.visitor.ResourceVisitor

Generic annotation scanner deployer.

Author:
Ales Justin

Constructor Summary
GenericAnnotationResourceVisitor(ClassLoader classLoader)
           
GenericAnnotationResourceVisitor(javassist.ClassPool pool, ClassLoader classLoader)
           
 
Method Summary
protected  List<org.jboss.deployers.plugins.annotations.CommitElement> createCommitList()
          Create commit list.
protected static org.jboss.metadata.spi.signature.Signature getBehaviorSignature(javassist.CtBehavior behavior, int index)
          Get parameters signature.
 AnnotationEnvironment getEnv()
          Get the built environment.
 org.jboss.classloading.spi.visitor.ResourceFilter getFilter()
           
protected static void handleAnnotations(ElementType type, javassist.CtMember member, Object[] annotations, String className, List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
          Handle annotations.
protected static void handleAnnotations(ElementType type, org.jboss.metadata.spi.signature.Signature signature, Object[] annotations, String className, List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
          Handle annotations.
protected  void handleCtClass(javassist.CtClass ctClass, List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
          Handle CtClass for annotations.
protected  void handleCtMembers(ElementType type, javassist.CtMember[] members, String className, List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
          Handle CtMembers for annotations.
protected  void logThrowable(org.jboss.classloading.spi.visitor.ResourceContext resource, Throwable t)
          Log throwable.
 void setCheckInterfaces(boolean checkInterfaces)
          Should we check interfaces for annotations as well.
 void setCheckSuper(boolean checkSuper)
          Should we check super class for annotations as well.
 void setForceAnnotations(boolean forceAnnotations)
          Should we force all annotations to be available.
 void setKeepAnnotations(boolean keepAnnotations)
          Set the keep annotations flag.
 void setResourceFilter(org.jboss.classloading.spi.visitor.ResourceFilter resourceFilter)
          Set the resource filter.
 void visit(org.jboss.classloading.spi.visitor.ResourceContext resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericAnnotationResourceVisitor

public GenericAnnotationResourceVisitor(ClassLoader classLoader)

GenericAnnotationResourceVisitor

public GenericAnnotationResourceVisitor(javassist.ClassPool pool,
                                        ClassLoader classLoader)
Method Detail

getFilter

public org.jboss.classloading.spi.visitor.ResourceFilter getFilter()
Specified by:
getFilter in interface org.jboss.classloading.spi.visitor.ResourceVisitor

visit

public void visit(org.jboss.classloading.spi.visitor.ResourceContext resource)
Specified by:
visit in interface org.jboss.classloading.spi.visitor.ResourceVisitor

createCommitList

protected List<org.jboss.deployers.plugins.annotations.CommitElement> createCommitList()
Create commit list.

Returns:
the commit list

logThrowable

protected void logThrowable(org.jboss.classloading.spi.visitor.ResourceContext resource,
                            Throwable t)
Log throwable.

Parameters:
resource - the resource we're visiting
t - the throwable

handleCtClass

protected void handleCtClass(javassist.CtClass ctClass,
                             List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
                      throws ClassNotFoundException,
                             javassist.NotFoundException
Handle CtClass for annotations.

Parameters:
ctClass - the ct class instance
commit - the commit list
Throws:
ClassNotFoundException - for any annotations lookup problems
javassist.NotFoundException - for any annotations lookup problems

handleCtMembers

protected void handleCtMembers(ElementType type,
                               javassist.CtMember[] members,
                               String className,
                               List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
                        throws ClassNotFoundException
Handle CtMembers for annotations.

Parameters:
type - where we found the annotations
members - the ct member instances
className - the className
commit - the commit list
Throws:
ClassNotFoundException - for any annotations lookup problems

getBehaviorSignature

protected static org.jboss.metadata.spi.signature.Signature getBehaviorSignature(javassist.CtBehavior behavior,
                                                                                 int index)
                                                                          throws ClassNotFoundException
Get parameters signature.

Parameters:
behavior - the ct behavior
index - the index
Returns:
parameters signature
Throws:
ClassNotFoundException - for any error

handleAnnotations

protected static void handleAnnotations(ElementType type,
                                        javassist.CtMember member,
                                        Object[] annotations,
                                        String className,
                                        List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
Handle annotations.

Parameters:
type - where we found the annotations
member - the ct member
annotations - the actual annotations
className - the className
commit - the commit list

handleAnnotations

protected static void handleAnnotations(ElementType type,
                                        org.jboss.metadata.spi.signature.Signature signature,
                                        Object[] annotations,
                                        String className,
                                        List<org.jboss.deployers.plugins.annotations.CommitElement> commit)
Handle annotations.

Parameters:
type - where we found the annotations
signature - the signature
annotations - the actual annotations
className - the className
commit - the commit list

setResourceFilter

public void setResourceFilter(org.jboss.classloading.spi.visitor.ResourceFilter resourceFilter)
Set the resource filter.

Parameters:
resourceFilter - the resource filter

setForceAnnotations

public void setForceAnnotations(boolean forceAnnotations)
Should we force all annotations to be available.

Parameters:
forceAnnotations - the force annotations flag

setKeepAnnotations

public void setKeepAnnotations(boolean keepAnnotations)
Set the keep annotations flag.

Parameters:
keepAnnotations - the keep annotations flag

setCheckSuper

public void setCheckSuper(boolean checkSuper)
Should we check super class for annotations as well.

Parameters:
checkSuper - the check super flag

setCheckInterfaces

public void setCheckInterfaces(boolean checkInterfaces)
Should we check interfaces for annotations as well.

Parameters:
checkInterfaces - the check interfaces flag

getEnv

public AnnotationEnvironment getEnv()
Get the built environment.

Returns:
the annoattion environment


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.