Class CssFormatter

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class CssFormatter
    extends java.lang.Object
    implements java.lang.Cloneable
    A formatter for the CSS output. Hold some formating states.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CssFormatter append​(char ch)
      Append a single character to the output.
      CssFormatter append​(double value)
      Append a decimal number to the output.
      CssFormatter append​(java.lang.String str)
      Append a string to the output.
      CssFormatter appendColor​(double color, java.lang.String hint)
      Append a color.
      void appendHex​(int value, int digits)
      Append an hex value to the output.
      CssFormatter appendValue​(double value, java.lang.String unit)
      Append a value with a unit.
      java.net.URL getBaseURL()
      Get the URL of the top less file.
      • Methods inherited from class java.lang.Object

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

      • getBaseURL

        public java.net.URL getBaseURL()
        Get the URL of the top less file.
        Returns:
        the URL
      • append

        public CssFormatter append​(java.lang.String str)
        Append a string to the output. In inline mode quotes are removed.
        Parameters:
        str - the string
        Returns:
        this
      • appendColor

        public CssFormatter appendColor​(double color,
                                        @Nullable
                                        java.lang.String hint)
        Append a color. In inline mode it is ever a 6 digit RGB value.
        Parameters:
        color - the color value
        hint - the original spelling of the color if not calculated
        Returns:
        this
      • appendHex

        public void appendHex​(int value,
                              int digits)
        Append an hex value to the output.
        Parameters:
        value - the value
        digits - the digits to write.
      • append

        public CssFormatter append​(char ch)
        Append a single character to the output.
        Parameters:
        ch - the character
        Returns:
        a reference to this object
      • append

        public CssFormatter append​(double value)
        Append a decimal number to the output.
        Parameters:
        value - the number
        Returns:
        a reference to this object
      • appendValue

        public CssFormatter appendValue​(double value,
                                        java.lang.String unit)
        Append a value with a unit. In compress mode not all units are written.
        Parameters:
        value - the value.
        unit - the unit
        Returns:
        a reference to this object