public class Store extends Object
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
Modifier | Constructor and Description |
---|---|
protected |
Store() |
protected |
Store(boolean concurrent) |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.Multimap<String,String> |
get(Class<? extends Scanner> scannerClass)
return the multimap store of the given scanner class.
|
Set<String> |
get(Class<? extends Scanner> scannerClass,
String... keys)
get the values of given keys stored for the given scanner class
|
Set<String> |
getFieldsAnnotatedWith(String annotation)
get fields annotated with a given annotation
|
Set<String> |
getInheritedSubTypes(Iterable<String> types,
String annotation,
boolean honorInherited) |
Integer |
getKeysCount()
return the keys count
|
Set<String> |
getMethodsAnnotatedWith(String annotation)
get method names annotated with a given annotation
|
com.google.common.collect.Multimap<String,String> |
getOrCreate(String indexName) |
Set<String> |
getResources(Pattern pattern)
get resources relative paths where simple name (key) matches given regular expression
|
Set<String> |
getResources(com.google.common.base.Predicate<String> namePredicate)
get resources relative paths where simple name (key) matches given namePredicate
|
Set<String> |
getResources(String key)
get resources relative paths where simple name (key) equals given name
|
Map<String,com.google.common.collect.Multimap<String,String>> |
getStoreMap()
return the store map.
|
Set<String> |
getSubTypesOf(String type)
get sub types of a given type
|
Set<String> |
getTypesAnnotatedWith(String annotation)
get types annotated with a given annotation, both classes and annotations
|
Set<String> |
getTypesAnnotatedWith(String annotation,
boolean honorInherited)
get types annotated with a given annotation, both classes and annotations
|
Set<String> |
getTypesAnnotatedWithDirectly(String annotation)
get types directly annotated with a given annotation, both classes and annotations
|
Integer |
getValuesCount()
return the values count
|
boolean |
isAnnotation(String typeAnnotatedWith)
is the given type is an annotation, based on the metadata stored by TypeAnnotationsScanner
|
boolean |
isClass(String type)
is the given type name a class.
|
boolean |
isInheritedAnnotation(String typeAnnotatedWith)
is the given annotation an inherited annotation, based on the metadata stored by TypeAnnotationsScanner
|
boolean |
isInterface(String aClass)
is the given type name an interface.
|
@Nullable public com.google.common.collect.Multimap<String,String> get(Class<? extends Scanner> scannerClass)
public Set<String> get(Class<? extends Scanner> scannerClass, String... keys)
public Map<String,com.google.common.collect.Multimap<String,String>> getStoreMap()
public Integer getKeysCount()
public Integer getValuesCount()
public Set<String> getTypesAnnotatedWithDirectly(String annotation)
public Set<String> getTypesAnnotatedWith(String annotation)
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.
public Set<String> getTypesAnnotatedWith(String annotation, boolean honorInherited)
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.
public Set<String> getInheritedSubTypes(Iterable<String> types, String annotation, boolean honorInherited)
public Set<String> getMethodsAnnotatedWith(String annotation)
public Set<String> getFieldsAnnotatedWith(String annotation)
public Set<String> getResources(String key)
public Set<String> getResources(com.google.common.base.Predicate<String> namePredicate)
public Set<String> getResources(Pattern pattern)
Set<String> xmls = reflections.getResources(".\*\.xml");
public boolean isClass(String type)
causes class loading
public boolean isInterface(String aClass)
causes class loading
public boolean isAnnotation(String typeAnnotatedWith)
public boolean isInheritedAnnotation(String typeAnnotatedWith)
Copyright © 2012. All Rights Reserved.