Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.kohsuke.stapler.jelly.jruby;
 
 import  org.apache.commons.jelly.Script;
 

Author(s):
Kohsuke Kawaguchi
public abstract class AbstractRubyTearOff extends AbstractTearOff<JRubyClassLoaderTearOff,Script,IOException> {
    protected AbstractRubyTearOff(MetaClass owner) {
        super(ownerJRubyClassLoaderTearOff.class);
    }

    
Defines the file extension, like ".erb", that designates this kind of view type.
    @Override
    protected abstract String getDefaultScriptExtension();
    public Script parseScript(URL resthrows IOException {
        return WebApp.getCurrent().getFacet(JRubyFacet.class).parseScript(res);
    }

    
Creates a RequestDispatcher that forwards to the jelly view, if available.
    public RequestDispatcher createDispatcher(Object itString viewNamethrows IOException {
        Script script = findScript(viewName+getDefaultScriptExtension());
        if(script!=null)
            return new JellyRequestDispatcher(it,script);
        return null;
    }
New to GrepCode? Check out our FAQ X