org.apache.myfaces.test.mock.resource
Class MockResourceHandler
java.lang.Object
javax.faces.application.ResourceHandler
org.apache.myfaces.test.mock.resource.MockResourceHandler
public class MockResourceHandler
- extends javax.faces.application.ResourceHandler
Mock implementation of ResourceHandler
.
This ResourceHandler implementation try to follow the default algorithm
defined by the spec, so it try to load resources using the current
ExternalContext and the specified ClassLoader, in the same locations
it is expected ("resources" and "META-INF/resources").
- Since:
- 1.0.0
- Version:
- $Revision: 990408 $ $Date: 2010-08-28 20:59:21 +0200 (Sat, 28 Aug 2010) $
- Author:
- Leonardo Uribe (latest modification by $Author: lu4242 $)
Fields inherited from class javax.faces.application.ResourceHandler |
LOCALE_PREFIX, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockResourceHandler
public MockResourceHandler()
MockResourceHandler
public MockResourceHandler(ClassLoader classLoader)
MockResourceHandler
public MockResourceHandler(boolean extensionMapping,
String mapping,
ClassLoader classLoader)
createResource
public javax.faces.application.Resource createResource(String resourceName)
- Specified by:
createResource
in class javax.faces.application.ResourceHandler
createResource
public javax.faces.application.Resource createResource(String resourceName,
String libraryName)
- Specified by:
createResource
in class javax.faces.application.ResourceHandler
createResource
public javax.faces.application.Resource createResource(String resourceName,
String libraryName,
String contentType)
- Specified by:
createResource
in class javax.faces.application.ResourceHandler
deriveResourceMeta
protected MockResourceMeta deriveResourceMeta(MockResourceLoader resourceLoader,
String resourceName,
String libraryName)
- 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.
getRendererTypeForResourceName
public String getRendererTypeForResourceName(String resourceName)
- Specified by:
getRendererTypeForResourceName
in class javax.faces.application.ResourceHandler
handleResourceRequest
public void handleResourceRequest(javax.faces.context.FacesContext context)
throws IOException
- Specified by:
handleResourceRequest
in class javax.faces.application.ResourceHandler
- Throws:
IOException
isResourceRequest
public boolean isResourceRequest(javax.faces.context.FacesContext facesContext)
- Specified by:
isResourceRequest
in class javax.faces.application.ResourceHandler
libraryExists
public boolean libraryExists(String libraryName)
- Specified by:
libraryExists
in class javax.faces.application.ResourceHandler
getLocalePrefixForLocateResource
protected String getLocalePrefixForLocateResource()
getResourceHandlerSupport
public MockResourceHandlerSupport getResourceHandlerSupport()
setResourceHandlerSupport
public void setResourceHandlerSupport(MockResourceHandlerSupport resourceHandlerSupport)
setResourceRequest
public void setResourceRequest(boolean resourceRequest)
isResourceRequest
public boolean isResourceRequest()
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.