net.stickycode.metadata
Interface MetadataResolverRegistry


public interface MetadataResolverRegistry

 Inject
 MetadataResolverRegisty usingMetadata;
 
 ...
 
 Field field = findField();
 if (withMetadata.is(field).metaAnnotatedWith(Configured.class)
   doSomethingWithAnnotatedField(field);
   
 ...
 
 Method method = fieldMethod();
 if (usingMetadata.is(method).metaAnnotatedWith(Scheduled.class)
   doSomethingWithAnnotatedMethod(method);
 
 ...
 
 Class type = findType();
 if (usingMetadata.is(type).annotatedWith(StickRepository.class)
   doSomethingWithAnnoatedType(type);
   
 ...
 
 Class type = findType();
 if (usingMetadata.does(type).haveAnyFieldsAnnotatedWith(Configured.class, ConfiguredStrategy.class)
   doSomethingWithTypeWithAnnotedElements();
   
 ...
 
 Class type = findType();
 if (usingMetadata.does(type).haveAnyMethodsAnnotatedWith(Scheduled.class, Pulse.class)
   doSomethingWithTypeWithAnnotedElements();
 


Method Summary
 ElementMetadataResolver does(Class<?> type)
          return a resolver for the given class that can resolve annotations on methods or fields of the type itself methods or fileds of the interfaces of the type methods or fields of any of the supertypes methods or fields of any of the interfaces of the super types
 MetadataResolver is(AnnotatedElement annotatedElement)
          return a resolver for the given annotation element that can resolve annotations on the element itself any of the super elements
 MetadataResolver is(Class<?> annotatedClass)
          return a resolver for the given class that can resolve annotations on the type itself interfaces of the type any of the supertypes any of the interfaces of the super types
 MetadataResolver is(Field field)
          return a resolver for the given field that can resolve annotations on the field itself annotations on the field
 MetadataResolver is(Method method)
          return a resolver for the given method that can resolve annotations on the method itself annotations on the method
 

Method Detail

is

MetadataResolver is(Method method)
return a resolver for the given method that can resolve annotations on
  1. the method itself
  2. annotations on the method


is

MetadataResolver is(Field field)
return a resolver for the given field that can resolve annotations on
  1. the field itself
  2. annotations on the field


is

MetadataResolver is(Class<?> annotatedClass)
return a resolver for the given class that can resolve annotations on
  1. the type itself
  2. interfaces of the type
  3. any of the supertypes
  4. any of the interfaces of the super types


does

ElementMetadataResolver does(Class<?> type)
return a resolver for the given class that can resolve annotations on
  1. methods or fields of the type itself
  2. methods or fileds of the interfaces of the type
  3. methods or fields of any of the supertypes
  4. methods or fields of any of the interfaces of the super types


is

MetadataResolver is(AnnotatedElement annotatedElement)
return a resolver for the given annotation element that can resolve annotations on
  1. the element itself
  2. any of the super elements



Copyright © 2011-2012 RedEngine Ltd. All Rights Reserved.