org.kohsuke.stapler
Class Facet

java.lang.Object
  extended by org.kohsuke.stapler.Facet

public abstract class Facet
extends Object

Aspect of stapler that brings in an optional language binding. Put MetaInfServices on subtypes so that Stapler can discover them.

Author:
Kohsuke Kawaguchi

Field Summary
static Logger LOGGER
           
 
Constructor Summary
Facet()
           
 
Method Summary
abstract  void buildViewDispatchers(MetaClass owner, List<Dispatcher> dispatchers)
          Adds Dispatchers that look at one token and binds that to the views associated with the 'it' object.
abstract  javax.servlet.RequestDispatcher createRequestDispatcher(RequestImpl request, Class type, Object it, String viewName)
          Creates a RequestDispatcher that handles the given view, or return null if no such view was found.
static List<Facet> discover(ClassLoader cl)
          Discovers all the facets in the classloader.
static
<T> List<T>
discoverExtensions(Class<T> type, ClassLoader cl)
           
abstract  boolean handleIndexRequest(RequestImpl req, ResponseImpl rsp, Object node, MetaClass nodeMetaClass)
          Attempts to route the HTTP request to the 'index' page of the 'it' object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

public static final Logger LOGGER
Constructor Detail

Facet

public Facet()
Method Detail

buildViewDispatchers

public abstract void buildViewDispatchers(MetaClass owner,
                                          List<Dispatcher> dispatchers)
Adds Dispatchers that look at one token and binds that to the views associated with the 'it' object.


discover

public static List<Facet> discover(ClassLoader cl)
Discovers all the facets in the classloader.


discoverExtensions

public static <T> List<T> discoverExtensions(Class<T> type,
                                             ClassLoader cl)

createRequestDispatcher

public abstract javax.servlet.RequestDispatcher createRequestDispatcher(RequestImpl request,
                                                                        Class type,
                                                                        Object it,
                                                                        String viewName)
                                                                 throws IOException
Creates a RequestDispatcher that handles the given view, or return null if no such view was found.

Parameters:
type - If "it" is non-null, it.getClass(). Otherwise the class from which the view is searched.
Throws:
IOException

handleIndexRequest

public abstract boolean handleIndexRequest(RequestImpl req,
                                           ResponseImpl rsp,
                                           Object node,
                                           MetaClass nodeMetaClass)
                                    throws IOException,
                                           javax.servlet.ServletException
Attempts to route the HTTP request to the 'index' page of the 'it' object.

Returns:
true if the processing succeeds. Otherwise false.
Throws:
IOException
javax.servlet.ServletException


Copyright © 2010. All Rights Reserved.