Module io.sf.carte.css4j
Package io.sf.carte.doc.style.css.om
Class ColorDeclarationFormattingContext
java.lang.Object
io.sf.carte.doc.style.css.om.DefaultDeclarationFormattingContext
io.sf.carte.doc.style.css.om.ColorDeclarationFormattingContext
- All Implemented Interfaces:
DeclarationFormattingContext
,Serializable
- Direct Known Subclasses:
RGBColorDeclarationFormattingContext
DeclarationFormattingContext that allows customization of serialized colors.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
writeColor
(SimpleWriter wri, String propertyName, CSSColorValue value) Write a cssCOLOR
to the given writer.protected void
writeColorMix
(SimpleWriter wri, String propertyName, CSSColorMixFunction value) Write a cssCOLOR_MIX
to the given writer.protected void
writeMinifiedColor
(SimpleWriter wri, String propertyName, CSSColorValue value) Write a minified cssCOLOR
value to the given writer.protected void
writeMinifiedColorMix
(SimpleWriter wri, String propertyName, CSSColorMixFunction value) Write a minified cssCOLOR_MIX
value to the given writer.void
writeMinifiedValue
(SimpleWriter wri, String propertyName, CSSValue value) Write a minified css value to the given writer.void
writeValue
(SimpleWriter wri, String propertyName, CSSValue value) Write a css value to the given writer.Methods inherited from class io.sf.carte.doc.style.css.om.DefaultDeclarationFormattingContext
endPropertyDeclaration, startPropertyDeclaration, writeColon, writeComma, writeFullIndent, writeSemiColon, writeURL
-
Constructor Details
-
ColorDeclarationFormattingContext
public ColorDeclarationFormattingContext()
-
-
Method Details
-
writeValue
Description copied from interface:DeclarationFormattingContext
Write a css value to the given writer.The default implementation calls
CSSValue.writeCssText(SimpleWriter)
.- Parameters:
wri
- the writer.propertyName
- the name of the property whose value is being printed.value
- the value to write.- Throws:
IOException
- if an error happened while writing.
-
writeColor
protected void writeColor(SimpleWriter wri, String propertyName, CSSColorValue value) throws IOException Write a cssCOLOR
to the given writer.This implementation calls
CSSValue.writeCssText(SimpleWriter)
.- Parameters:
wri
- the writer.propertyName
- the name of the property whose value is being printed.value
- the value to write.- Throws:
IOException
- if an error happened while writing.
-
writeColorMix
protected void writeColorMix(SimpleWriter wri, String propertyName, CSSColorMixFunction value) throws IOException Write a cssCOLOR_MIX
to the given writer.This implementation calls
CSSValue.writeCssText(SimpleWriter)
.- Parameters:
wri
- the writer.propertyName
- the name of the property whose value is being printed.value
- the value to write.- Throws:
IOException
- if an error happened while writing.
-
writeMinifiedValue
public void writeMinifiedValue(SimpleWriter wri, String propertyName, CSSValue value) throws IOException Description copied from interface:DeclarationFormattingContext
Write a minified css value to the given writer.Note that in order to guarantee some consistency, shorthands may not use this method to minify values.
The default implementation just writes
CSSValue.getMinifiedCssText(String)
.- Parameters:
wri
- the writer.propertyName
- the name of the property whose value is being printed.value
- the value to write.- Throws:
IOException
- if an error happened while writing.
-
writeMinifiedColor
protected void writeMinifiedColor(SimpleWriter wri, String propertyName, CSSColorValue value) throws IOException Write a minified cssCOLOR
value to the given writer.This implementation just writes
CSSValue.getMinifiedCssText(String)
.- Parameters:
wri
- the writer.propertyName
- the name of the property whose value is being printed.value
- the value to write.- Throws:
IOException
- if an error happened while writing.
-
writeMinifiedColorMix
protected void writeMinifiedColorMix(SimpleWriter wri, String propertyName, CSSColorMixFunction value) throws IOException Write a minified cssCOLOR_MIX
value to the given writer.This implementation just writes
CSSValue.getMinifiedCssText(String)
.- Parameters:
wri
- the writer.propertyName
- the name of the property whose value is being printed.value
- the value to write.- Throws:
IOException
- if an error happened while writing.
-