1 22 package org.jboss.metadata.spi.retrieval.basic; 23 24 import java.lang.annotation.Annotation ; 25 26 import org.jboss.metadata.spi.loader.MetaDataLoader; 27 import org.jboss.metadata.spi.retrieval.AnnotationItem; 28 29 36 public class BasicAnnotationItem<T extends Annotation > extends BasicMetaDataItem<T> implements AnnotationItem<T> 37 { 38 44 public BasicAnnotationItem(MetaDataLoader loader, T annotation) 45 { 46 super(loader, annotation.annotationType().getName(), annotation); 47 } 48 49 public T getAnnotation() 50 { 51 return getValue(); 52 } 53 54 public boolean equals(Object object) 55 { 56 if (object == this) 57 return true; 58 if (object == null || object instanceof AnnotationItem == false) 59 return false; 60 61 AnnotationItem other = (AnnotationItem) object; 62 return getAnnotation().annotationType().equals(other.getAnnotation().annotationType()); 63 } 64 } 65 | Popular Tags |