Class GadgetHandlers
- java.lang.Object
-
- org.glassfish.admingui.common.gadget.GadgetHandlers
-
public class GadgetHandlers extends Object
This class provides access to
GadgetModule
s. It also has a nice JSON utility for converting JavaBean Objects (and primitives, Collections, Maps, Strings, etc.) to JSON.- Author:
- Ken Paulsen ([email protected])
-
-
Constructor Summary
Constructors Constructor Description GadgetHandlers()
Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
getGadgetModule(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler returns aGadgetModule
for the named gadget.static GadgetModule
getGadgetModule(URL url)
This method returns aGadgetModule
for the given URL.static Object
invokeHandler(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler will invoke another handler.static Object
parseString(String test)
-
-
-
Method Detail
-
getGadgetModule
public static void getGadgetModule(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler returns a
GadgetModule
for the named gadget. Thename
should either be a complete URL, or a context-root relative path to the gadget XML file (this also includes .xml files stored in .jar's / plugins).
-
getGadgetModule
public static GadgetModule getGadgetModule(URL url)
This method returns a
GadgetModule
for the given URL.
-
invokeHandler
public static Object invokeHandler(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)
This handler will invoke another handler. This allows a generic handler to invoke another one and return the response(s), if any.
The following are the inputs are supported:
- handler - (required) This input specifies the handler which should be invoked.
- args - (required) This specifies all of the arguments to be passed to the handler (both input and output arguments). The value of this should be a String formatted as a comma separated list of name-value pairs (which are themselves separated by colons (:). The value of the name-value pairs should be URL encoded (so that commas are escaped).
- depth - (optional) This property specifies the max depth of nesting for any output values from the handler. Output values are encoded in JSON. This prevents infinite looping in the case where an Object refers to itself (or in the case wehre there is unnecessarily deep data structures).
-
-