Package com.inet.lib.less
Class CssFormatter
- java.lang.Object
-
- com.inet.lib.less.CssFormatter
-
- All Implemented Interfaces:
java.lang.Cloneable
public class CssFormatter extends java.lang.Object implements java.lang.CloneableA formatter for the CSS output. Hold some formating states.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CssFormatterappend(char ch)Append a single character to the output.CssFormatterappend(double value)Append a decimal number to the output.CssFormatterappend(java.lang.String str)Append a string to the output.CssFormatterappendColor(double color, java.lang.String hint)Append a color.voidappendHex(int value, int digits)Append an hex value to the output.CssFormatterappendValue(double value, java.lang.String unit)Append a value with a unit.java.net.URLgetBaseURL()Get the URL of the top less file.
-
-
-
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 valuehint- 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 valuedigits- 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
-
-