|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.clearsilver.jsilver.resourceloader.CompositeResourceLoader
public class CompositeResourceLoader
ResourceLoader composed of other ResourceLoaders. When a resource is loaded, it will search through each ResourceLoader until it finds something.
ResourceLoader
Constructor Summary | |
---|---|
CompositeResourceLoader(Iterable<ResourceLoader> loaders)
|
|
CompositeResourceLoader(ResourceLoader... loaders)
|
Method Summary | |
---|---|
void |
add(ResourceLoader loader)
|
void |
close(Reader reader)
Close the reader. |
Object |
getKey(String filename)
We return the filename as the key of uniqueness as we assume that if this CompositeResourceLoader is in use, then there won't be another ResourceLoader that we are competing against. |
Object |
getResourceVersionId(String filename)
Return the first non-null version identifier found among the ResourceLoaders, using the same search order as open(String) . |
Reader |
open(String name)
Open a resource. |
Reader |
openOrFail(String name)
Open a resource or throw an exception if no such resource is found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeResourceLoader(Iterable<ResourceLoader> loaders)
public CompositeResourceLoader(ResourceLoader... loaders)
Method Detail |
---|
public void add(ResourceLoader loader)
public Reader open(String name) throws IOException
ResourceLoader
ResourceLoader.close(Reader)
when done with the
reader.
open
in interface ResourceLoader
name
- the name of the resource
IOException
- if resource fails to openpublic Reader openOrFail(String name) throws JSilverTemplateNotFoundException, IOException
ResourceLoader
ResourceLoader.close(Reader)
when done with the
reader.
openOrFail
in interface ResourceLoader
name
- the name of the resource
JSilverTemplateNotFoundException
- if resource is not found
IOException
- if resource fails to openpublic void close(Reader reader) throws IOException
ResourceLoader
close
in interface ResourceLoader
reader
- the reader to close
IOException
- if reader fasils to closepublic Object getKey(String filename)
getKey
in interface ResourceLoader
filename
- the name we want to identify
public Object getResourceVersionId(String filename)
open(String)
.
getResourceVersionId
in interface ResourceLoader
filename
- the name of the resource to check for resources
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |