Enum DebugFlag

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DebugFlag>

    public enum DebugFlag
    extends java.lang.Enum<DebugFlag>
    Enumeration of the various cq5 debug flags
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      LAYOUT
      displays layout information
      MDEV
      display mobile device info as inline HTML
      MDEVC
      display mobile device info as HTML comments
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEBUG_PARAM_NAME
      Default parameter name of the debug request parameter
      static java.lang.String REQUEST_ATTRIBUTE_NAME
      name of the request attribute
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set<DebugFlag> fromRequest​(ServletRequest req)
      Returns the debug mode for the current request, if set in the request attributes
      static java.util.Set<DebugFlag> fromRequestParameter​(ServletRequest request, java.lang.String parameterName)
      Return the current set of debug modes defined by supplied request parameter.
      static DebugFlag valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DebugFlag[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LAYOUT

        public static final DebugFlag LAYOUT
        displays layout information
      • MDEV

        public static final DebugFlag MDEV
        display mobile device info as inline HTML
      • MDEVC

        public static final DebugFlag MDEVC
        display mobile device info as HTML comments
    • Field Detail

      • REQUEST_ATTRIBUTE_NAME

        public static final java.lang.String REQUEST_ATTRIBUTE_NAME
        name of the request attribute
      • DEBUG_PARAM_NAME

        public static final java.lang.String DEBUG_PARAM_NAME
        Default parameter name of the debug request parameter
        See Also:
        Constant Field Values
    • Method Detail

      • values

        public static DebugFlag[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DebugFlag c : DebugFlag.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DebugFlag valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • fromRequest

        public static java.util.Set<DebugFlag> fromRequest​(ServletRequest req)
        Returns the debug mode for the current request, if set in the request attributes
        Parameters:
        req - request
        Returns:
        debug mode, empty Set if not defined in request attributes
      • fromRequestParameter

        public static java.util.Set<DebugFlag> fromRequestParameter​(ServletRequest request,
                                                                    java.lang.String parameterName)
        Return the current set of debug modes defined by supplied request parameter. If the set was already stored in the request attributes, return that.
        Parameters:
        request - the current request
        parameterName - the (multi-valued) request parameter that defines debug modes
        Returns:
        the Set of DebugFlag, from request attributes if present, else computed, empty Set if no debug modes defined.