Package org.kohsuke.stapler
Class AbstractTearOff<CLT,S,E extends Exception>
- java.lang.Object
-
- org.kohsuke.stapler.CachingScriptLoader<S,E>
-
- org.kohsuke.stapler.AbstractTearOff<CLT,S,E>
-
- Type Parameters:
CLT
- ClassLoader tear-off.
public abstract class AbstractTearOff<CLT,S,E extends Exception> extends CachingScriptLoader<S,E>
Partial default implementation of tear-off class, for convenience of derived classes.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description protected CLT
classLoader
protected MetaClass
owner
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTearOff(MetaClass owner, Class<CLT> cltClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract String
getDefaultScriptExtension()
The file extension of this kind of scripts, such as ".jelly"protected URL
getResource(String name)
protected WebApp
getWebApp()
protected boolean
hasAllowedExtension(String name)
Checks if the file name is allowed as a script of this type.protected S
loadScript(String name)
Cache-less version of theCachingScriptLoader.findScript(String)
that provides the actual logic.protected abstract S
parseScript(URL res)
Compiles a script into the compiled form.S
resolveScript(String name)
Loads the script just from the target class without considering inherited scripts from its base types.-
Methods inherited from class org.kohsuke.stapler.CachingScriptLoader
clearScripts, findScript
-
-
-
-
Method Detail
-
getWebApp
protected final WebApp getWebApp()
-
getDefaultScriptExtension
protected abstract String getDefaultScriptExtension()
The file extension of this kind of scripts, such as ".jelly"
-
hasAllowedExtension
protected boolean hasAllowedExtension(String name)
Checks if the file name is allowed as a script of this type. This is necessary to have multiple facets co-exist peacefully without them trying to load each other's scripts.
-
resolveScript
public S resolveScript(String name) throws E extends Exception
Loads the script just from the target class without considering inherited scripts from its base types.
-
loadScript
protected final S loadScript(String name) throws E extends Exception
Description copied from class:CachingScriptLoader
Cache-less version of theCachingScriptLoader.findScript(String)
that provides the actual logic.- Specified by:
loadScript
in classCachingScriptLoader<S,E extends Exception>
- Throws:
E extends Exception
-
parseScript
protected abstract S parseScript(URL res) throws E extends Exception
Compiles a script into the compiled form.
-
getResource
protected URL getResource(String name)
- Specified by:
getResource
in classCachingScriptLoader<S,E extends Exception>
-
-