org.apache.myfaces.commons.resourcehandler
Class ExtendedResourceHandlerImpl

java.lang.Object
  extended by javax.faces.application.ResourceHandler
      extended by javax.faces.application.ResourceHandlerWrapper
          extended by org.apache.myfaces.commons.resourcehandler.ExtendedResourceHandlerImpl
All Implemented Interfaces:
javax.faces.FacesWrapper<javax.faces.application.ResourceHandler>

public class ExtendedResourceHandlerImpl
extends javax.faces.application.ResourceHandlerWrapper

Author:
Leonardo Uribe

Field Summary
 
Fields inherited from class javax.faces.application.ResourceHandler
LOCALE_PREFIX, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER
 
Constructor Summary
ExtendedResourceHandlerImpl(javax.faces.application.ResourceHandler delegate)
           
 
Method Summary
 javax.faces.application.Resource createResource(String resourceName, String libraryName)
           
 javax.faces.application.Resource createResource(String resourceName, String libraryName, String contentType)
           
protected  ExtendedResourceMeta deriveResourceMeta(ResourceLoader resourceLoader, String resourceName, String libraryName, String localePrefix)
          This method try to create a ResourceMeta for a specific resource loader.
protected  String getLocalePrefixForLocateResource()
           
protected  ExtendedDefaultResourceHandlerSupport getResourceHandlerSupport()
           
 javax.faces.application.ResourceHandler getWrapped()
           
 void handleResourceRequest(javax.faces.context.FacesContext facesContext)
          Handle the resource request, writing in the output.
protected  boolean isResourceIdentifierExcluded(javax.faces.context.FacesContext context, String resourceIdentifier)
           
 boolean isResourceRequest(javax.faces.context.FacesContext facesContext)
           
 boolean libraryExists(String libraryName)
          Check if a library exists or not.
 String resolveLibraryName(String libraryName)
           
 void setResourceHandlerSupport(ExtendedDefaultResourceHandlerSupport resourceHandlerSupport)
           
 
Methods inherited from class javax.faces.application.ResourceHandlerWrapper
createResource, getRendererTypeForResourceName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedResourceHandlerImpl

public ExtendedResourceHandlerImpl(javax.faces.application.ResourceHandler delegate)
Method Detail

createResource

public javax.faces.application.Resource createResource(String resourceName,
                                                       String libraryName)
Overrides:
createResource in class javax.faces.application.ResourceHandlerWrapper

createResource

public javax.faces.application.Resource createResource(String resourceName,
                                                       String libraryName,
                                                       String contentType)
Overrides:
createResource in class javax.faces.application.ResourceHandlerWrapper

resolveLibraryName

public String resolveLibraryName(String libraryName)

deriveResourceMeta

protected ExtendedResourceMeta deriveResourceMeta(ResourceLoader resourceLoader,
                                                  String resourceName,
                                                  String libraryName,
                                                  String localePrefix)
This method try to create a ResourceMeta for a specific resource loader. If no library, or resource is found, just return null, so the algorithm in createResource can continue checking with the next registered ResourceLoader.


handleResourceRequest

public void handleResourceRequest(javax.faces.context.FacesContext facesContext)
                           throws IOException
Handle the resource request, writing in the output. This method implements an algorithm semantically identical to the one described on the javadoc of ResourceHandler.handleResourceRequest

Overrides:
handleResourceRequest in class javax.faces.application.ResourceHandlerWrapper
Throws:
IOException

isResourceRequest

public boolean isResourceRequest(javax.faces.context.FacesContext facesContext)
Overrides:
isResourceRequest in class javax.faces.application.ResourceHandlerWrapper

getLocalePrefixForLocateResource

protected String getLocalePrefixForLocateResource()

isResourceIdentifierExcluded

protected boolean isResourceIdentifierExcluded(javax.faces.context.FacesContext context,
                                               String resourceIdentifier)

libraryExists

public boolean libraryExists(String libraryName)
Check if a library exists or not. This is done delegating to each ResourceLoader used, because each one has a different prefix and way to load resources.

Overrides:
libraryExists in class javax.faces.application.ResourceHandlerWrapper

setResourceHandlerSupport

public void setResourceHandlerSupport(ExtendedDefaultResourceHandlerSupport resourceHandlerSupport)
Parameters:
resourceHandlerSupport - the resourceHandlerSupport to set

getResourceHandlerSupport

protected ExtendedDefaultResourceHandlerSupport getResourceHandlerSupport()
Returns:
the resourceHandlerSupport

getWrapped

public javax.faces.application.ResourceHandler getWrapped()
Specified by:
getWrapped in interface javax.faces.FacesWrapper<javax.faces.application.ResourceHandler>
Overrides:
getWrapped in class javax.faces.application.ResourceHandlerWrapper


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.