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 voidwriteColor(SimpleWriter wri, String propertyName, CSSColorValue value) Write a cssCOLORto the given writer.protected voidwriteColorMix(SimpleWriter wri, String propertyName, CSSColorMixFunction value) Write a cssCOLOR_MIXto the given writer.protected voidwriteMinifiedColor(SimpleWriter wri, String propertyName, CSSColorValue value) Write a minified cssCOLORvalue to the given writer.protected voidwriteMinifiedColorMix(SimpleWriter wri, String propertyName, CSSColorMixFunction value) Write a minified cssCOLOR_MIXvalue to the given writer.voidwriteMinifiedValue(SimpleWriter wri, String propertyName, CSSValue value) Write a minified css value to the given writer.voidwriteValue(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:DeclarationFormattingContextWrite 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 cssCOLORto 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_MIXto 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:DeclarationFormattingContextWrite 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 cssCOLORvalue 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_MIXvalue 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.
-