1 22 package org.jboss.metadata.spi.retrieval.helper; 23 24 import org.jboss.metadata.spi.retrieval.AnnotationItem; 25 import org.jboss.metadata.spi.retrieval.MetaDataItem; 26 27 34 public class AnnotationToMetaDataBridge<T> implements MetaDataItem<T> 35 { 36 37 private AnnotationItem annotation; 38 39 44 public AnnotationToMetaDataBridge(AnnotationItem annotation) 45 { 46 if (annotation == null) 47 throw new IllegalArgumentException ("Null annotation"); 48 this.annotation = annotation; 49 } 50 51 public boolean isCachable() 52 { 53 return annotation.isCachable(); 54 } 55 56 public boolean isValid() 57 { 58 return annotation.isValid(); 59 } 60 61 @SuppressWarnings ("unchecked") 62 public T getValue() 63 { 64 return (T) annotation.getValue(); 65 } 66 67 public String getName() 68 { 69 return annotation.getName(); 70 } 71 } 72 | Popular Tags |