Class GadgetHandlers


  • public class GadgetHandlers
    extends Object

    This class provides access to GadgetModules. 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 Detail

      • GadgetHandlers

        public GadgetHandlers()

        Default constructor.

    • Method Detail

      • getGadgetModule

        public static void getGadgetModule​(com.sun.jsftemplating.layout.descriptors.handler.HandlerContext handlerCtx)

        This handler returns a GadgetModule for the named gadget. The name 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).

      • 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).
      • parseString

        public static Object parseString​(String test)