public abstract class Facet
extends java.lang.Object
MetaInfServices
on subtypes so that Stapler can discover them.Modifier and Type | Field and Description |
---|---|
static java.util.logging.Logger |
LOGGER |
Constructor and Description |
---|
Facet() |
Modifier and Type | Method and Description |
---|---|
void |
buildFallbackDispatchers(MetaClass owner,
java.util.List<Dispatcher> dispatchers)
Adds
Dispatcher s that do catch-all behaviours like "doDispatch" does. |
abstract void |
buildViewDispatchers(MetaClass owner,
java.util.List<Dispatcher> dispatchers)
Adds
Dispatcher s that look at one token and binds that
to the views associated with the 'it' object. |
javax.servlet.RequestDispatcher |
createRequestDispatcher(RequestImpl request,
java.lang.Class type,
java.lang.Object it,
java.lang.String viewName) |
javax.servlet.RequestDispatcher |
createRequestDispatcher(RequestImpl request,
Klass<?> type,
java.lang.Object it,
java.lang.String viewName)
Creates a
RequestDispatcher that handles the given view, or
return null if no such view was found. |
static java.util.List<Facet> |
discover(java.lang.ClassLoader cl)
Discovers all the facets in the classloader.
|
static <T> java.util.List<T> |
discoverExtensions(java.lang.Class<T> type,
java.lang.ClassLoader... cls) |
Klass<?> |
getKlass(java.lang.Object o)
Maps an instance to a
Klass . |
abstract boolean |
handleIndexRequest(RequestImpl req,
ResponseImpl rsp,
java.lang.Object node,
MetaClass nodeMetaClass)
Attempts to route the HTTP request to the 'index' page of the 'it' object.
|
public abstract void buildViewDispatchers(MetaClass owner, java.util.List<Dispatcher> dispatchers)
Dispatcher
s that look at one token and binds that
to the views associated with the 'it' object.public void buildFallbackDispatchers(MetaClass owner, java.util.List<Dispatcher> dispatchers)
Dispatcher
s that do catch-all behaviours like "doDispatch" does.public static java.util.List<Facet> discover(java.lang.ClassLoader cl)
public static <T> java.util.List<T> discoverExtensions(java.lang.Class<T> type, java.lang.ClassLoader... cls)
public javax.servlet.RequestDispatcher createRequestDispatcher(RequestImpl request, Klass<?> type, java.lang.Object it, java.lang.String viewName) throws java.io.IOException
RequestDispatcher
that handles the given view, or
return null if no such view was found.type
- If "it" is non-null, it.getClass()
. Otherwise the class
from which the view is searched.java.io.IOException
public javax.servlet.RequestDispatcher createRequestDispatcher(RequestImpl request, java.lang.Class type, java.lang.Object it, java.lang.String viewName) throws java.io.IOException
java.io.IOException
public abstract boolean handleIndexRequest(RequestImpl req, ResponseImpl rsp, java.lang.Object node, MetaClass nodeMetaClass) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public Klass<?> getKlass(java.lang.Object o)
Klass
. This is the generalization of o.getClass()
.
This is for those languages that use something other than Class
to represent the concept of a class.
Those facets that are fine with o.getClass()
should return null so that it gives other facets a chance
to map it better.Copyright © 2013. All Rights Reserved.