Enum WebSource

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

    public enum WebSource
    extends java.lang.Enum<WebSource>
    The source from the web.
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    RequestAttribute, SessionAttribute, RequestParam, RequestHeader, CookieValue, RequestBody, PathVariable, MatrixVariable, HttpServletRequest, ServerHttpRequest
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String getValue​(org.springframework.web.context.request.NativeWebRequest request, java.lang.String name)
      Get the value of the request by the specified name
      static WebSource valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static WebSource[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

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

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

      • REQUEST_ATTRIBUTE

        public static final WebSource REQUEST_ATTRIBUTE
        The source from the request attribute
        See Also:
        RequestAttribute
      • SESSION_ATTRIBUTE

        public static final WebSource SESSION_ATTRIBUTE
        The source from the session attribute
        See Also:
        SessionAttribute
      • REQUEST_PARAMETER

        public static final WebSource REQUEST_PARAMETER
        The source from the request parameter
        See Also:
        RequestParam
      • REQUEST_HEADER

        public static final WebSource REQUEST_HEADER
        The source from the request header
        See Also:
        RequestHeader
      • REQUEST_COOKIE

        public static final WebSource REQUEST_COOKIE
        The source from the request cookie
        See Also:
        CookieValue
      • REQUEST_BODY

        public static final WebSource REQUEST_BODY
        The source from the request body
        See Also:
        RequestBody
      • PATH_VARIABLE

        public static final WebSource PATH_VARIABLE
        The source from the request path variable
        See Also:
        PathVariable
      • MATRIX_VARIABLE

        public static final WebSource MATRIX_VARIABLE
        The source from the request matrix variable
        See Also:
        MatrixVariable
    • Method Detail

      • values

        public static WebSource[] 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 (WebSource c : WebSource.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static WebSource 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
      • getValue

        @Nullable
        public abstract java.lang.String getValue​(org.springframework.web.context.request.NativeWebRequest request,
                                                  java.lang.String name)
        Get the value of the request by the specified name
        Parameters:
        request - NativeWebRequest
        name - the name of request value
        Returns:
        null if not found