|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.renderkit.html.util.MyFacesResourceHandler
public class MyFacesResourceHandler
Class whose instances represent a resource inside the tomahawk jarfile which a custom component needs to tell a browser to fetch.
Constructor Summary | |
---|---|
MyFacesResourceHandler(java.lang.Class myfacesCustomComponent,
java.lang.String resourceName)
Constructor. |
Method Summary | |
---|---|
java.lang.Class |
getResourceLoaderClass()
Return a Class object which can decode the url generated by this class in the getResourceUri method and use that info to locate the resource data represented by this object. |
java.lang.String |
getResourceUri(javax.faces.context.FacesContext context)
Return a URL that the browser can later submit to retrieve the resource handled by this instance. |
protected void |
validateCustomComponent(java.lang.Class myfacesCustomComponent)
Verify that the base class for the resource lookup is in the org.apache.myfaces.custom package. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.myfaces.renderkit.html.util.ResourceHandler |
---|
equals, hashCode |
Constructor Detail |
---|
public MyFacesResourceHandler(java.lang.Class myfacesCustomComponent, java.lang.String resourceName)
myfacesCustomComponent
- is a class that must be in package
org.apache.myfaces.custom. The resource to be served will be
located relative to this class in the classpath. Note that code
wishing to serve resources from other locations in the classpath
must write a custom ResourceHandler implementation.resourceName
- is the name of a file that can be found in dir
"resource/{resourceName} relative to the location of the specified
component class in the classpath.Method Detail |
---|
public java.lang.Class getResourceLoaderClass()
getResourceLoaderClass
in interface ResourceHandler
ResourceHandler.getResourceLoaderClass()
protected void validateCustomComponent(java.lang.Class myfacesCustomComponent)
myfacesCustomComponent
- is the base component for the lookup.
java.lang.IllegalArgumentException
- if the class is not in the expected package.public java.lang.String getResourceUri(javax.faces.context.FacesContext context)
The emitted URL is of form:
{partial.class.name}/{resourceName}where partial.class.name is the name of the base class specified in the constructor, and resourceName is the resource specified in the constructor.
getResourceUri
in interface ResourceHandler
org.apache.myfaces.shared.renderkit.html.util.ResourceHandler#getResourceUri(javax.faces.context.FacesContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |