1 22 package org.jboss.metadata.plugins.loader; 23 24 import java.lang.annotation.Annotation ; 25 26 import org.jboss.metadata.annotation.AnnotationMatcher; 27 import org.jboss.metadata.generic.GenericMatcher; 28 import org.jboss.metadata.spi.retrieval.AnnotationItem; 29 import org.jboss.metadata.spi.retrieval.MetaDataItem; 30 import org.jboss.metadata.spi.scope.ScopeKey; 31 32 38 public abstract class BasicMetaDataLoader extends AbstractMetaDataLoader 39 { 40 43 public BasicMetaDataLoader() 44 { 45 } 46 47 52 public BasicMetaDataLoader(ScopeKey key) 53 { 54 super(key); 55 } 56 57 public <T extends Annotation > AnnotationItem<T> retrieveAnnotation(Class <T> annotationType) 58 { 59 AnnotationItem[] annotations = retrieveAnnotations().getAnnotations(); 60 return AnnotationMatcher.matchAnnotationItem(annotations, annotationType); 61 } 62 63 public MetaDataItem retrieveMetaData(String name) 64 { 65 MetaDataItem[] metaDatas = retrieveMetaData().getMetaDatas(); 66 return GenericMatcher.matchMetaDataItem(metaDatas, name); 67 } 68 } 69 | Popular Tags |