|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.reflections.Store
public class Store
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 | |
|---|---|
protected |
Store()
|
protected |
Store(boolean concurrent)
|
| Method Summary | |
|---|---|
protected com.google.common.collect.ListMultimap<String,String> |
createMultimap()
|
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,
Iterable<String> keys)
get the values of given keys stored for 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> |
getConstructorsAnnotatedWith(String annotation)
get constructor names annotated with a given annotation |
Set<String> |
getFieldsAnnotatedWith(String annotation)
get fields annotated with a given annotation |
Set<String> |
getInheritedSubTypes(Iterable<String> types,
String annotation,
boolean honorInherited)
when honoring @Inherited, meta-annotation should only effect annotated super classes and it's sub types |
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Store()
protected Store(boolean concurrent)
| Method Detail |
|---|
protected com.google.common.collect.ListMultimap<String,String> createMultimap()
public com.google.common.collect.Multimap<String,String> getOrCreate(String indexName)
@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 Set<String> get(Class<? extends Scanner> scannerClass,
Iterable<String> keys)
public Map<String,com.google.common.collect.Multimap<String,String>> getStoreMap()
public Integer getKeysCount()
public Integer getValuesCount()
public Set<String> getSubTypesOf(String type)
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
when honoring @Inherited, meta-annotation should only effect annotated super classes and it's sub types
when not honoring @Inherited, meta annotation effects all subtypes, including annotations interfaces and classes
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)
when honoring @Inherited, meta-annotation should only effect annotated super classes and it's sub types
when not honoring @Inherited, meta annotation effects all subtypes, including annotations interfaces and classes
public Set<String> getMethodsAnnotatedWith(String annotation)
public Set<String> getFieldsAnnotatedWith(String annotation)
public Set<String> getConstructorsAnnotatedWith(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 isAnnotation(String typeAnnotatedWith)
public boolean isInheritedAnnotation(String typeAnnotatedWith)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||