org.reflections
Class Store

java.lang.Object
  extended by org.reflections.Store

public class Store
extends java.lang.Object

stores metadata information in multimaps

use the different query methods (getXXX) to query the metadata

the query methods are string based, and does not cause the class loader to define the types

use Reflections.getStore() to access this store


Constructor Summary
Store()
           
 
Method Summary
 com.google.common.collect.Multimap<java.lang.String,java.lang.String> get(java.lang.Class<? extends Scanner> scannerClass)
          return the multimap store of the given scanner class.
 java.util.Set<java.lang.String> get(java.lang.Class<? extends Scanner> scannerClass, java.lang.String... keys)
          get the values of given keys stored for the given scanner class
 java.util.Set<java.lang.String> getConverters(java.lang.String from, java.lang.String to)
          get 'converter' methods that could effectively convert from type 'from' to type 'to'
 java.util.Set<java.lang.String> getFieldsAnnotatedWith(java.lang.String annotation)
          get fields annotated with a given annotation
 java.lang.Integer getKeysCount()
          return the keys count
 java.util.Set<java.lang.String> getMethodsAnnotatedWith(java.lang.String annotation)
          get method names annotated with a given annotation
 java.util.Set<java.lang.String> getResources(java.util.regex.Pattern pattern)
          get resources relative paths where simple name (key) matches given regular expression
 java.util.Set<java.lang.String> getResources(com.google.common.base.Predicate<java.lang.String> namePredicate)
          get resources relative paths where simple name (key) matches given namePredicate
 java.util.Set<java.lang.String> getResources(java.lang.String key)
          get resources relative paths where simple name (key) equals given name
 java.util.Map<java.lang.String,com.google.common.collect.Multimap<java.lang.String,java.lang.String>> getStoreMap()
          return the store map.
 java.util.Set<java.lang.String> getSubTypesOf(java.lang.String type)
          get sub types of a given type
 com.google.common.collect.Multiset<java.lang.String> getSuperTypes()
          get all super types that have stored sub types, based on the metadata stored by SubTypesScanner
 java.util.Set<java.lang.String> getTypeAnnotations()
          get all annotations, based on metadata stored by TypeAnnotationsScanner
 java.util.Set<java.lang.String> getTypesAnnotatedWith(java.lang.String annotation)
          get types annotated with a given annotation, both classes and annotations
 java.util.Set<java.lang.String> getTypesAnnotatedWith(java.lang.String annotation, boolean honorInherited)
          get types annotated with a given annotation, both classes and annotations
 java.lang.Integer getValuesCount()
          return the values count
 boolean hasSubTypes(java.lang.String typeAnnotatedWith)
          does the given type has sub types, based on the metadata stored by SubTypesScanner
 boolean isAnnotation(java.lang.String typeAnnotatedWith)
          is the given type is an annotation, based on the metadata stored by TypeAnnotationsScanner
 boolean isClass(java.lang.String type)
          is the given type name a class.
 boolean isInheritedAnnotation(java.lang.String typeAnnotatedWith)
          is the given annotation an inherited annotation, based on the metadata stored by TypeAnnotationsScanner
 boolean isInterface(java.lang.String aClass)
          is the given type name an interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Store

public Store()
Method Detail

get

public java.util.Set<java.lang.String> get(java.lang.Class<? extends Scanner> scannerClass,
                                           java.lang.String... keys)
get the values of given keys stored for the given scanner class


get

public com.google.common.collect.Multimap<java.lang.String,java.lang.String> get(java.lang.Class<? extends Scanner> scannerClass)
return the multimap store of the given scanner class. not immutable


getStoreMap

public java.util.Map<java.lang.String,com.google.common.collect.Multimap<java.lang.String,java.lang.String>> getStoreMap()
return the store map. not immutable


getKeysCount

public java.lang.Integer getKeysCount()
return the keys count


getValuesCount

public java.lang.Integer getValuesCount()
return the values count


getSubTypesOf

public java.util.Set<java.lang.String> getSubTypesOf(java.lang.String type)
get sub types of a given type


getTypesAnnotatedWith

public java.util.Set<java.lang.String> getTypesAnnotatedWith(java.lang.String annotation)
get types annotated with a given annotation, both classes and annotations

Inherited is honored

Note that this (@Inherited) meta-annotation type has no effect if the annotated type is used for anything other than a class. Also, this meta-annotation causes annotations to be inherited only from superclasses; annotations on implemented interfaces have no effect.


getTypesAnnotatedWith

public java.util.Set<java.lang.String> getTypesAnnotatedWith(java.lang.String annotation,
                                                             boolean honorInherited)
get types annotated with a given annotation, both classes and annotations

Inherited is honored according to given honorInherited

Note that this (@Inherited) meta-annotation type has no effect if the annotated type is used for anything other than a class. Also, this meta-annotation causes annotations to be inherited only from superclasses; annotations on implemented interfaces have no effect.


getMethodsAnnotatedWith

public java.util.Set<java.lang.String> getMethodsAnnotatedWith(java.lang.String annotation)
get method names annotated with a given annotation


getFieldsAnnotatedWith

public java.util.Set<java.lang.String> getFieldsAnnotatedWith(java.lang.String annotation)
get fields annotated with a given annotation


getConverters

public java.util.Set<java.lang.String> getConverters(java.lang.String from,
                                                     java.lang.String to)
get 'converter' methods that could effectively convert from type 'from' to type 'to'


getResources

public java.util.Set<java.lang.String> getResources(java.lang.String key)
get resources relative paths where simple name (key) equals given name


getResources

public java.util.Set<java.lang.String> getResources(com.google.common.base.Predicate<java.lang.String> namePredicate)
get resources relative paths where simple name (key) matches given namePredicate


getResources

public java.util.Set<java.lang.String> getResources(java.util.regex.Pattern pattern)
get resources relative paths where simple name (key) matches given regular expression
Set<String> xmls = reflections.getResources(".\*\.xml");


isClass

public boolean isClass(java.lang.String type)
is the given type name a class.

causes class loading


isInterface

public boolean isInterface(java.lang.String aClass)
is the given type name an interface.

causes class loading


isAnnotation

public boolean isAnnotation(java.lang.String typeAnnotatedWith)
is the given type is an annotation, based on the metadata stored by TypeAnnotationsScanner


isInheritedAnnotation

public boolean isInheritedAnnotation(java.lang.String typeAnnotatedWith)
is the given annotation an inherited annotation, based on the metadata stored by TypeAnnotationsScanner


hasSubTypes

public boolean hasSubTypes(java.lang.String typeAnnotatedWith)
does the given type has sub types, based on the metadata stored by SubTypesScanner


getSuperTypes

public com.google.common.collect.Multiset<java.lang.String> getSuperTypes()
get all super types that have stored sub types, based on the metadata stored by SubTypesScanner


getTypeAnnotations

public java.util.Set<java.lang.String> getTypeAnnotations()
get all annotations, based on metadata stored by TypeAnnotationsScanner



Copyright © 2010. All Rights Reserved.