org.kohsuke.stapler
Class AbstractTearOff<CLT,S,E extends java.lang.Exception>

java.lang.Object
  extended by org.kohsuke.stapler.AbstractTearOff<CLT,S,E>
Direct Known Subclasses:
GroovyClassTearOff, JellyClassTearOff

public abstract class AbstractTearOff<CLT,S,E extends java.lang.Exception>
extends java.lang.Object

Partial default implementation of tear-off class, for convenience of derived classes.

Author:
Kohsuke Kawaguchi

Field Summary
protected  CLT classLoader
           
protected  MetaClass owner
           
 
Constructor Summary
protected AbstractTearOff(MetaClass owner, java.lang.Class<CLT> cltClass)
           
 
Method Summary
protected  java.net.URL findResource(java.lang.String name, java.lang.ClassLoader cl)
           
 S findScript(java.lang.String name)
          Locates the view script of the given name.
protected abstract  S parseScript(java.net.URL res)
          Compiles a script into the compiled form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

protected final MetaClass owner

classLoader

protected final CLT classLoader
Constructor Detail

AbstractTearOff

protected AbstractTearOff(MetaClass owner,
                          java.lang.Class<CLT> cltClass)
Method Detail

findScript

public S findScript(java.lang.String name)
             throws E extends java.lang.Exception
Locates the view script of the given name.

Parameters:
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 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.

Throws:
E extends java.lang.Exception

parseScript

protected abstract S parseScript(java.net.URL res)
                          throws E extends java.lang.Exception
Compiles a script into the compiled form.

Throws:
E extends java.lang.Exception

findResource

protected final java.net.URL findResource(java.lang.String name,
                                          java.lang.ClassLoader cl)


Copyright © 2007. All Rights Reserved.