org.jboss.deployers.plugins.annotations
Class AbstractElement<A extends Annotation,M extends AnnotatedElement>

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.deployers.plugins.annotations.AbstractElement<A,M>
Type Parameters:
A - the annotation type
M - the annotated element type
All Implemented Interfaces:
Cloneable, Element<A,M>, org.jboss.util.JBossInterface
Direct Known Subclasses:
ClassElement, DefaultElement

public abstract class AbstractElement<A extends Annotation,M extends AnnotatedElement>
extends org.jboss.util.JBossObject
implements Element<A,M>

Abstract annotations element.

Author:
Ales Justin

Field Summary
protected  Class<A> annClass
           
protected  String className
           
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
AbstractElement(ClassLoader classLoader, String className, Class<A> annClass, A annotation)
           
 
Method Summary
 boolean equals(Object obj)
           
 A getAnnotation()
          Get the annotation instance.
protected  ClassLoader getClassLoader()
          Get the classloader from weak ref.
 int getHashCode()
           
 Class<?> getOwner()
          Get the annotation owner class.
 String getOwnerClassName()
          Get the owner class name.
protected  Class<?> loadClass(String className)
          Load class from class name.
protected  A readAnnotation()
          Read the annotation.
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, hashCode, list, notEqual, toShortString, toShortString, toString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.deployers.spi.annotations.Element
getAnnotatedElement
 

Field Detail

className

protected String className

annClass

protected Class<A extends Annotation> annClass
Constructor Detail

AbstractElement

public AbstractElement(ClassLoader classLoader,
                       String className,
                       Class<A> annClass,
                       A annotation)
Method Detail

getOwnerClassName

public String getOwnerClassName()
Description copied from interface: Element
Get the owner class name. Until we hit getOwner method the class should not be loaded.

Specified by:
getOwnerClassName in interface Element<A extends Annotation,M extends AnnotatedElement>
Returns:
the owner classname

getOwner

public Class<?> getOwner()
Description copied from interface: Element
Get the annotation owner class.

Specified by:
getOwner in interface Element<A extends Annotation,M extends AnnotatedElement>
Returns:
the annotation owner class

getAnnotation

public A getAnnotation()
Description copied from interface: Element
Get the annotation instance.

Specified by:
getAnnotation in interface Element<A extends Annotation,M extends AnnotatedElement>
Returns:
the annotation instance

readAnnotation

protected A readAnnotation()
Read the annotation.

Returns:
the read annotation

getHashCode

public int getHashCode()
Overrides:
getHashCode in class org.jboss.util.JBossObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getClassLoader

protected ClassLoader getClassLoader()
Get the classloader from weak ref.

Returns:
the classloader

loadClass

protected Class<?> loadClass(String className)
Load class from class name.

Parameters:
className - the class name
Returns:
loaded class


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