org.kohsuke.stapler.jelly
Class JellyFacet

java.lang.Object
  extended by org.kohsuke.stapler.Facet
      extended by org.kohsuke.stapler.jelly.JellyFacet
All Implemented Interfaces:
JellyCompatibleFacet

@MetaInfServices(value=org.kohsuke.stapler.Facet.class)
public class JellyFacet
extends org.kohsuke.stapler.Facet
implements JellyCompatibleFacet

Facet that adds Jelly as the view.

Author:
Kohsuke Kawaguchi

Field Summary
 ResourceBundleFactory resourceBundleFactory
          Used to load ResourceBundles.
 ScriptInvoker scriptInvoker
          Used to invoke Jelly script.
static boolean TRACE
          This flag will activate the Jelly evaluation trace.
 
Fields inherited from class org.kohsuke.stapler.Facet
LOGGER
 
Constructor Summary
JellyFacet()
           
 
Method Summary
 void buildViewDispatchers(org.kohsuke.stapler.MetaClass owner, List<org.kohsuke.stapler.Dispatcher> dispatchers)
           
 javax.servlet.RequestDispatcher createRequestDispatcher(org.kohsuke.stapler.RequestImpl request, Class type, Object it, String viewName)
           
 Collection<Class<JellyClassTearOff>> getClassTearOffTypes()
           
 Collection<String> getScriptExtensions()
          Gets the list of view script extensions, such as ".jelly".
 boolean handleIndexRequest(org.kohsuke.stapler.RequestImpl req, org.kohsuke.stapler.ResponseImpl rsp, Object node, org.kohsuke.stapler.MetaClass nodeMetaClass)
           
static void setExpressionFactory(javax.servlet.ServletContextEvent event, org.apache.commons.jelly.expression.ExpressionFactory factory)
          Sets the Jelly ExpressionFactory to be used to parse views.
 
Methods inherited from class org.kohsuke.stapler.Facet
buildFallbackDispatchers, discover, discoverExtensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scriptInvoker

public volatile ScriptInvoker scriptInvoker
Used to invoke Jelly script. Can be replaced to the custom object.


resourceBundleFactory

public volatile ResourceBundleFactory resourceBundleFactory
Used to load ResourceBundles.


TRACE

public static boolean TRACE
This flag will activate the Jelly evaluation trace. It generates extra comments into HTML, indicating where the fragment was rendered.

Constructor Detail

JellyFacet

public JellyFacet()
Method Detail

buildViewDispatchers

public void buildViewDispatchers(org.kohsuke.stapler.MetaClass owner,
                                 List<org.kohsuke.stapler.Dispatcher> dispatchers)
Specified by:
buildViewDispatchers in class org.kohsuke.stapler.Facet

getClassTearOffTypes

public Collection<Class<JellyClassTearOff>> getClassTearOffTypes()
Specified by:
getClassTearOffTypes in interface JellyCompatibleFacet

getScriptExtensions

public Collection<String> getScriptExtensions()
Description copied from interface: JellyCompatibleFacet
Gets the list of view script extensions, such as ".jelly".

Specified by:
getScriptExtensions in interface JellyCompatibleFacet

createRequestDispatcher

public javax.servlet.RequestDispatcher createRequestDispatcher(org.kohsuke.stapler.RequestImpl request,
                                                               Class type,
                                                               Object it,
                                                               String viewName)
                                                        throws IOException
Specified by:
createRequestDispatcher in class org.kohsuke.stapler.Facet
Throws:
IOException

handleIndexRequest

public boolean handleIndexRequest(org.kohsuke.stapler.RequestImpl req,
                                  org.kohsuke.stapler.ResponseImpl rsp,
                                  Object node,
                                  org.kohsuke.stapler.MetaClass nodeMetaClass)
                           throws IOException,
                                  javax.servlet.ServletException
Specified by:
handleIndexRequest in class org.kohsuke.stapler.Facet
Throws:
IOException
javax.servlet.ServletException

setExpressionFactory

public static void setExpressionFactory(javax.servlet.ServletContextEvent event,
                                        org.apache.commons.jelly.expression.ExpressionFactory factory)
Sets the Jelly ExpressionFactory to be used to parse views.

This method should be invoked from your implementation of ServletContextListener.contextInitialized(ServletContextEvent).

Once views are parsed, they won't be re-parsed just because you called this method to override the expression factory.

The primary use case of this feature is to customize the behavior of JEXL evaluation.



Copyright © 2011. All Rights Reserved.