Class CssRequest

  • All Implemented Interfaces:
    Serializable

    public final class CssRequest
    extends Object
    implements Serializable
    Client-side model for requesting info about a CSS file. Can be either a URI or some CSS content. Note: This class must be serializable / deserializable via JSON.
    Since:
    7.1.0
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Detail

      • CssRequest

        public CssRequest()
    • Method Detail

      • getSourceUrl

        public URI getSourceUrl()
        Returns:
        Absolute location of the stylesheet.
      • getType

        public ECssRequestType getType()
        Returns:
        The type of the CSS request, either a URI or literal CSS content.
      • getValue

        public String getValue()
        Returns:
        The CSS data, either a URI or literal CSS content, depending on getType().
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • setSourceUrl

        public void setSourceUrl​(URI sourceUri)
        Parameters:
        sourceUri - Absolute location of the stylesheet.
      • setType

        public void setType​(ECssRequestType type)
        Parameters:
        type - The type of the CSS request, either a URI or literal CSS content.
      • setValue

        public void setValue​(String value)
        Parameters:
        value - The CSS data, either a URI or literal CSS content, depending on getType().
      • forInline

        public static CssRequest forInline​(String content,
                                           URI sourceUrl)
        Parameters:
        content - Content of the CSS file.
        sourceUrl - Absolute URL of the stylesheet.
        Returns:
        A new CSS request for the given content.
      • forUri

        public static CssRequest forUri​(String uri,
                                        URI baseUrl)
        Parameters:
        uri - URI to the CSS file.
        baseUrl - Absolute base URL relative to which to interpret the given URI.
        Returns:
        A new CSS request for the given URI.