org.apache.myfaces.config.annotation
Class DefaultAnnotationProvider

java.lang.Object
  extended by org.apache.myfaces.spi.AnnotationProvider
      extended by org.apache.myfaces.config.annotation.DefaultAnnotationProvider
All Implemented Interfaces:
javax.faces.FacesWrapper<AnnotationProvider>

public class DefaultAnnotationProvider
extends AnnotationProvider

Since:
2.0.2
Author:
Leonardo Uribe

Field Summary
static java.lang.String SCAN_PACKAGES
           Servlet context init parameter which defines which packages to scan for beans, separated by commas.
 
Constructor Summary
DefaultAnnotationProvider()
           
 
Method Summary
 java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.Set<java.lang.Class<?>>> getAnnotatedClasses(javax.faces.context.ExternalContext ctx)
          Retrieve a map containing the classes that contains annotations used by jsf implementation at startup.
protected  java.util.Collection<java.lang.Class<?>> getAnnotatedMetaInfClasses(javax.faces.context.ExternalContext ctx, java.util.Set<java.net.URL> urls)
           
protected  java.util.Collection<java.lang.Class<?>> getAnnotatedMyfacesImplClasses(javax.faces.context.ExternalContext ctx, java.net.URL url)
           
protected  java.util.Collection<java.lang.Class<?>> getAnnotatedWebInfClasses(javax.faces.context.ExternalContext ctx)
           
 java.util.Set<java.net.URL> getBaseUrls()
          The returned Set<URL> urls are calculated in this way ( see JSF 2.0 spec section 11.4.2 for definitions )
 
Methods inherited from class org.apache.myfaces.spi.AnnotationProvider
getWrapped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCAN_PACKAGES

@JSFWebConfigParam(since="2.0")
public static final java.lang.String SCAN_PACKAGES

Servlet context init parameter which defines which packages to scan for beans, separated by commas.

See Also:
Constant Field Values
Constructor Detail

DefaultAnnotationProvider

public DefaultAnnotationProvider()
Method Detail

getAnnotatedClasses

public java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.Set<java.lang.Class<?>>> getAnnotatedClasses(javax.faces.context.ExternalContext ctx)
Description copied from class: AnnotationProvider
Retrieve a map containing the classes that contains annotations used by jsf implementation at startup.

The default implementation must comply with JSF 2.0 spec section 11.5.1 Requirements for scanning of classes for annotations.

This method could call getBaseUrls() to obtain a list of URL that could be used to indicate jar files of annotations in the classpath.

If the element in the WEB-INF/faces-config.xml file contains metadata-complete attribute whose value is "true", this method should not be called.

Specified by:
getAnnotatedClasses in class AnnotationProvider
Parameters:
ctx - The current ExternalContext
Returns:
A map with all classes that could contain annotations.

getBaseUrls

public java.util.Set<java.net.URL> getBaseUrls()
                                        throws java.io.IOException
Description copied from class: AnnotationProvider

The returned Set<URL> urls are calculated in this way ( see JSF 2.0 spec section 11.4.2 for definitions )

  1. All resources that match either "META-INF/faces-config.xml" or end with ".facesconfig.xml" directly in the "META-INF" directory (considered applicationConfigurationResources)

Specified by:
getBaseUrls in class AnnotationProvider
Returns:
Throws:
java.io.IOException

getAnnotatedMetaInfClasses

protected java.util.Collection<java.lang.Class<?>> getAnnotatedMetaInfClasses(javax.faces.context.ExternalContext ctx,
                                                                              java.util.Set<java.net.URL> urls)

getAnnotatedMyfacesImplClasses

protected java.util.Collection<java.lang.Class<?>> getAnnotatedMyfacesImplClasses(javax.faces.context.ExternalContext ctx,
                                                                                  java.net.URL url)

getAnnotatedWebInfClasses

protected java.util.Collection<java.lang.Class<?>> getAnnotatedWebInfClasses(javax.faces.context.ExternalContext ctx)
                                                                      throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.