Class StylesheetInfo

java.lang.Object
org.xhtmlrenderer.css.sheet.StylesheetInfo

public class StylesheetInfo extends Object
A reference to a stylesheet. If no stylesheet is set, the matcher will try to find the stylesheet by uri, first from the StylesheetFactory cache, then by loading the uri if it is not cached.

Therefore, either a stylesheet must be set, or an uri must be set

Origin defaults to USER_AGENT and media defaults to "all"

  • Field Details

  • Constructor Details

  • Method Details

    • appliesToMedia

      public boolean appliesToMedia(String media)
      Checks if this stylesheet applies to given medium
      Parameters:
      media - a single media identifier
      Returns:
      true if the stylesheet referenced applies to the medium
    • mediaTypes

      public static List<String> mediaTypes(String media)
    • getUri

      @CheckReturnValue public String getUri()
      Gets the uri attribute of the StylesheetInfo object
      Returns:
      The uri value
    • getMedia

      @CheckReturnValue public @NonNull List<String> getMedia()
      Gets the media attribute of the StylesheetInfo object
      Returns:
      The media value
    • getOrigin

      public StylesheetInfo.Origin getOrigin()
      Gets the origin attribute of the StylesheetInfo object
      Returns:
      The origin value
    • getContent

      @CheckReturnValue public Optional<String> getContent()
    • toString

      public String toString()
      Overrides:
      toString in class Object