public abstract class CachingScriptLoader<S,E extends java.lang.Exception>
extends java.lang.Object
Constructor and Description |
---|
CachingScriptLoader() |
Modifier and Type | Method and Description |
---|---|
void |
clearScripts()
Discards the cached script.
|
S |
findScript(java.lang.String name)
Locates the view script of the given name.
|
protected abstract java.net.URL |
getResource(java.lang.String name) |
protected abstract S |
loadScript(java.lang.String name)
Cache-less version of the
findScript(String) that provides the actual logic. |
public S findScript(java.lang.String name) throws E extends java.lang.Exception
name
- if this is a relative path, such as "foo.jelly" or "foo/bar.groovy",
then it is assumed to be relative to this class, so
"org/acme/MyClass/foo.jelly" or "org/acme/MyClass/foo/bar.groovy"
will be searched.
If the extension is omitted, the default extension will be appended. This is useful for some loaders that support loading multiple file extension types (such as Jelly support.)
If this starts with "/", then it is assumed to be absolute, and that name is searched from the classloader. This is useful to do mix-in.
E extends java.lang.Exception
protected abstract S loadScript(java.lang.String name) throws E extends java.lang.Exception
findScript(String)
that provides the actual logic.E extends java.lang.Exception
public void clearScripts()
protected abstract java.net.URL getResource(java.lang.String name)
Copyright © 2013. All Rights Reserved.