Class DefaultGroovyByContentSpec

    • Constructor Detail

      • DefaultGroovyByContentSpec

        public DefaultGroovyByContentSpec​(ByContentSpec delegate)
    • Method Detail

      • type

        public GroovyByContentSpec type​(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​(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​(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​(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​(String mimeType,
                                        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​(CharSequence mimeType,
                                        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
      • 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​(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​(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​(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​(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