Class DefaultGroovyByContentSpec

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      GroovyByContentSpec html​(java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client wants content of type "text/html".
      GroovyByContentSpec html​(Block block)
      Specifies that the given handler should be used if the client wants content of type "text/html".
      GroovyByContentSpec html​(Handler handler)
      Specifies that the given handler should be used if the client wants content of type "text/html".
      GroovyByContentSpec json​(java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client wants content of type "application/json".
      GroovyByContentSpec json​(Block block)
      Specifies that the given handler should be used if the client wants content of type "application/json".
      GroovyByContentSpec json​(Handler handler)
      Specifies that the given handler should be used if the client wants content of type "application/json".
      GroovyByContentSpec noMatch​(java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.
      GroovyByContentSpec noMatch​(java.lang.String mimeType)
      Specifies that the handler for the specified content type should be used if the client's requested content type cannot be matched with any of the other handlers.
      GroovyByContentSpec noMatch​(Block block)
      Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.
      GroovyByContentSpec noMatch​(Handler handler)
      Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.
      GroovyByContentSpec plainText​(java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client wants content of type "text/plain".
      GroovyByContentSpec plainText​(Block block)
      Specifies that the given handler should be used if the client wants content of type "text/plain".
      GroovyByContentSpec plainText​(Handler handler)
      Specifies that the given handler should be used if the client wants content of type "text/plain".
      GroovyByContentSpec type​(java.lang.CharSequence mimeType, java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client wants content of the given MIME type.
      GroovyByContentSpec type​(java.lang.CharSequence mimeType, Block block)
      Specifies that the given handler should be used if the client wants content of the given MIME type.
      GroovyByContentSpec type​(java.lang.CharSequence mimeType, Handler handler)
      Specifies that the given handler should be used if the client wants content of the given MIME type.
      GroovyByContentSpec type​(java.lang.String mimeType, java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client wants content of the given MIME type.
      GroovyByContentSpec type​(java.lang.String mimeType, Block block)
      Specifies that the given handler should be used if the client wants content of the given MIME type.
      GroovyByContentSpec type​(java.lang.String mimeType, Handler handler)
      Specifies that the given handler should be used if the client wants content of the given MIME type.
      GroovyByContentSpec unspecified​(java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client did not provide a usable "Accept" header in the request.
      GroovyByContentSpec unspecified​(java.lang.String mimeType)
      Specifies that the handler for the specified content type should be used if the client did not provide a usable "Accept" header in the request.
      GroovyByContentSpec unspecified​(Block block)
      Specifies that the given handler should be used if the client did not provide a usable "Accept" header in the request.
      GroovyByContentSpec unspecified​(Handler handler)
      Specifies that the given handler should be used if the client did not provide a usable "Accept" header in the request.
      GroovyByContentSpec xml​(java.lang.Class<? extends Handler> handlerType)
      Specifies that the given handler should be used if the client wants content of type "application/xml".
      GroovyByContentSpec xml​(Block block)
      Specifies that the given handler should be used if the client wants content of type "application/xml".
      GroovyByContentSpec xml​(Handler handler)
      Specifies that the given handler should be used if the client wants content of type "application/xml".
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultGroovyByContentSpec

        public DefaultGroovyByContentSpec​(ByContentSpec delegate)
    • Method Detail

      • type

        public GroovyByContentSpec type​(java.lang.String mimeType,
                                        Block block)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).
        Specified by:
        type in interface ByContentSpec
        Specified by:
        type in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to register for
        block - the code to invoke if the content type matches
        Returns:
        this
      • type

        public GroovyByContentSpec type​(java.lang.CharSequence mimeType,
                                        Block block)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).
        Specified by:
        type in interface ByContentSpec
        Specified by:
        type in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to register for
        block - the code to invoke if the content type matches
        Returns:
        this
      • type

        public GroovyByContentSpec type​(java.lang.String mimeType,
                                        Handler handler)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).
        Specified by:
        type in interface ByContentSpec
        Specified by:
        type in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to register for
        handler - the handler to invoke if the content type matches
        Returns:
        this
      • type

        public GroovyByContentSpec type​(java.lang.CharSequence mimeType,
                                        Handler handler)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).
        Specified by:
        type in interface ByContentSpec
        Specified by:
        type in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to register for
        handler - the handler to invoke if the content type matches
        Returns:
        this
      • type

        public GroovyByContentSpec type​(java.lang.String mimeType,
                                        java.lang.Class<? extends Handler> handlerType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).
        Specified by:
        type in interface ByContentSpec
        Specified by:
        type in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to register for
        handlerType - the type of handler to retrieve from the registry and use
        Returns:
        this
      • type

        public GroovyByContentSpec type​(java.lang.CharSequence mimeType,
                                        java.lang.Class<? extends Handler> handlerType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of the given MIME type. This only supports fully-specified content types (no "*" wildcards).
        Specified by:
        type in interface ByContentSpec
        Specified by:
        type in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to register for
        handlerType - the type of handler to retrieve from the registry and use
        Returns:
        this
      • html

        public GroovyByContentSpec html​(java.lang.Class<? extends Handler> handlerType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of type "text/html".
        Specified by:
        html in interface ByContentSpec
        Specified by:
        html in interface GroovyByContentSpec
        Parameters:
        handlerType - the type of handler to retrieve from the registry and use
        Returns:
        this
      • json

        public GroovyByContentSpec json​(java.lang.Class<? extends Handler> handlerType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of type "application/json".
        Specified by:
        json in interface ByContentSpec
        Specified by:
        json in interface GroovyByContentSpec
        Parameters:
        handlerType - the type of handler to retrieve from the registry and use
        Returns:
        this
      • xml

        public GroovyByContentSpec xml​(java.lang.Class<? extends Handler> handlerType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client wants content of type "application/xml".
        Specified by:
        xml in interface ByContentSpec
        Specified by:
        xml in interface GroovyByContentSpec
        Parameters:
        handlerType - the type of handler to retrieve from the registry and use
        Returns:
        this
      • noMatch

        public GroovyByContentSpec noMatch​(Block block)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.
        Specified by:
        noMatch in interface ByContentSpec
        Specified by:
        noMatch in interface GroovyByContentSpec
        Parameters:
        block - the code to invoke if the content type doesn't match
        Returns:
        this
      • noMatch

        public GroovyByContentSpec noMatch​(java.lang.Class<? extends Handler> handlerType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client's requested content type cannot be matched with any of the other handlers.
        Specified by:
        noMatch in interface ByContentSpec
        Specified by:
        noMatch in interface GroovyByContentSpec
        Parameters:
        handlerType - the type of handler to retrieve from the registry and use
        Returns:
        this
      • noMatch

        public GroovyByContentSpec noMatch​(java.lang.String mimeType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the handler for the specified content type should be used if the client's requested content type cannot be matched with any of the other handlers. Effectively, this treats the request as if the user requested the specified MIME type. If the specified mimeType doesn't have a registered block, it will result in a server error for applicable requests.
        Specified by:
        noMatch in interface ByContentSpec
        Specified by:
        noMatch in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to use as a fallback if the requested type can't be matched
        Returns:
        this
      • unspecified

        public GroovyByContentSpec unspecified​(java.lang.Class<? extends Handler> handlerType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the given handler should be used if the client did not provide a usable "Accept" header in the request.
        Specified by:
        unspecified in interface ByContentSpec
        Specified by:
        unspecified in interface GroovyByContentSpec
        Parameters:
        handlerType - the type of handler to retrieve from the registry and use if no usable "Accept" header is present in the request.
        Returns:
        this
      • unspecified

        public GroovyByContentSpec unspecified​(java.lang.String mimeType)
        Description copied from interface: GroovyByContentSpec
        Specifies that the handler for the specified content type should be used if the client did not provide a usable "Accept" header in the request. Effectively, this treats the request as if the user requested the specified MIME type. If the specified mimeType doesn't have a registered block, it will result in a server error for applicable requests.
        Specified by:
        unspecified in interface ByContentSpec
        Specified by:
        unspecified in interface GroovyByContentSpec
        Parameters:
        mimeType - the MIME type to use as a fallback if no type is requested
        Returns:
        this