Errai 3.0.1-SNAPSHOT

org.jboss.errai.common.metadata
Class MetaDataScanner

java.lang.Object
  extended by org.jboss.errai.reflections.ReflectionUtils
      extended by org.jboss.errai.reflections.Reflections
          extended by org.jboss.errai.common.metadata.MetaDataScanner
Direct Known Subclasses:
GWTMetaDataScanner

public class MetaDataScanner
extends Reflections

Scans component meta data. The scanner creates a DeploymentContext that identifies nested subdeployments (i.e. WAR inside EAR) and processes the resulting archive Url's using the Reflections library.

The initial set of config URLs (entry points) is discovered through ErraiApp.properties.

Author:
Heiko Braun , Mike Brock , Christian Sadilek , Max Barkley

Nested Class Summary
static class MetaDataScanner.CacheHolder
           
 
Field Summary
static String ERRAI_CONFIG_STUB_NAME
           
 
Fields inherited from class org.jboss.errai.reflections.Reflections
configuration
 
Fields inherited from class org.jboss.errai.reflections.ReflectionUtils
primitiveDescriptors, primitiveNames, primitiveTypes
 
Method Summary
static MetaDataScanner createInstance(List<URL> urls)
           
static MetaDataScanner createInstance(List<URL> urls, File cacheFile)
           
static List<URL> getConfigUrls()
           
static List<URL> getConfigUrls(ClassLoader loader)
           
 com.google.common.collect.Multimap<String,String> getErraiProperties()
           
 Set<Field> getFieldsAnnotatedWith(Class<? extends Annotation> annotation, Collection<String> packages)
           
 String getHashForTypesAnnotatedWith(String seed, Class<? extends Annotation> annotation)
           
 Set<Method> getMethodsAnnotatedWith(Class<? extends Annotation> annotation, Collection<String> packages)
           
 Set<Method> getMethodsAnnotatedWithExcluding(Class<? extends Annotation> annotation, String excludeRegex)
           
 Set<Class<?>> getTypesAnnotatedWith(Class<? extends Annotation> annotation)
          get types annotated with a given annotation, both classes and annotations
 Set<Class<?>> getTypesAnnotatedWith(Class<? extends Annotation> annotation, Collection<String> packages)
           
 Set<Class<?>> getTypesAnnotatedWithExcluding(Class<? extends Annotation> annotation, String excludeRegex)
           
static void registerTypeHandler(Vfs.UrlType handler)
           
 
Methods inherited from class org.jboss.errai.reflections.Reflections
collect, collect, collect, collect, collect, getConverters, getFieldsAnnotatedWith, getFieldsAnnotatedWith, getMethodsAnnotatedWith, getMethodsAnnotatedWith, getMethodsWithAnyParamAnnotated, getResources, getResources, getStore, getSubTypesOf, getTypesAnnotatedWith, getTypesAnnotatedWith, getTypesAnnotatedWith, merge, save, save, scan
 
Methods inherited from class org.jboss.errai.reflections.ReflectionUtils
areAnnotationMembersMatching, areAnnotationMembersMatching, forName, forNames, getAllSuperTypes, getAllSuperTypesAnnotatedWith, getMatchingAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERRAI_CONFIG_STUB_NAME

public static final String ERRAI_CONFIG_STUB_NAME
See Also:
Constant Field Values
Method Detail

createInstance

public static MetaDataScanner createInstance(List<URL> urls)

createInstance

public static MetaDataScanner createInstance(List<URL> urls,
                                             File cacheFile)

registerTypeHandler

public static void registerTypeHandler(Vfs.UrlType handler)

getTypesAnnotatedWithExcluding

public Set<Class<?>> getTypesAnnotatedWithExcluding(Class<? extends Annotation> annotation,
                                                    String excludeRegex)

getTypesAnnotatedWith

public Set<Class<?>> getTypesAnnotatedWith(Class<? extends Annotation> annotation,
                                           Collection<String> packages)

getMethodsAnnotatedWithExcluding

public Set<Method> getMethodsAnnotatedWithExcluding(Class<? extends Annotation> annotation,
                                                    String excludeRegex)

getMethodsAnnotatedWith

public Set<Method> getMethodsAnnotatedWith(Class<? extends Annotation> annotation,
                                           Collection<String> packages)

getFieldsAnnotatedWith

public Set<Field> getFieldsAnnotatedWith(Class<? extends Annotation> annotation,
                                         Collection<String> packages)

getTypesAnnotatedWith

public Set<Class<?>> getTypesAnnotatedWith(Class<? extends Annotation> annotation)
Description copied from class: Reflections
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.

depends on TypeAnnotationsScanner and SubTypesScanner configured, otherwise an empty set is returned

Overrides:
getTypesAnnotatedWith in class Reflections

getHashForTypesAnnotatedWith

public String getHashForTypesAnnotatedWith(String seed,
                                           Class<? extends Annotation> annotation)

getConfigUrls

public static List<URL> getConfigUrls(ClassLoader loader)

getConfigUrls

public static List<URL> getConfigUrls()

getErraiProperties

public com.google.common.collect.Multimap<String,String> getErraiProperties()

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.