- All Known Subinterfaces:
StyleFormattingContext
- All Known Implementing Classes:
ColorDeclarationFormattingContext
,DefaultDeclarationFormattingContext
,DefaultStyleFormattingContext
,InlineStyleFormattingContext
,RGBColorDeclarationFormattingContext
public interface DeclarationFormattingContext
Define methods for formatting properties or descriptors in a declaration,
generally for a computed style.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Ends a property declaration in a rule style (does not apply to inline styles).void
Starts a property declaration in a rule style (does not apply to inline styles).void
writeColon
(SimpleWriter wri) Serialize a colon to aSimpleWriter
.void
writeComma
(SimpleWriter wri) Serialize a comma to aSimpleWriter
.void
Serialize a full paragraph indent to aSimpleWriter
.default void
writeMinifiedValue
(SimpleWriter wri, String propertyName, CSSValue value) Write a minified css value to the given writer.void
Serialize a semicolon to aSimpleWriter
.void
writeURL
(SimpleWriter wri, String href) Serialize a URL/URI to aSimpleWriter
.default void
writeValue
(SimpleWriter wri, String propertyName, CSSValue value) Write a css value to the given writer.
-
Method Details
-
startPropertyDeclaration
Starts a property declaration in a rule style (does not apply to inline styles).It is called before writing the property name.
- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
endPropertyDeclaration
Ends a property declaration in a rule style (does not apply to inline styles).It is called after
writeSemiColon(SimpleWriter)
.- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeColon
Serialize a colon to aSimpleWriter
.- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeComma
Serialize a comma to aSimpleWriter
.- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeFullIndent
Serialize a full paragraph indent to aSimpleWriter
.- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeSemiColon
Serialize a semicolon to aSimpleWriter
.Called after writing the property name.
- Parameters:
wri
- the writer.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeURL
Serialize a URL/URI to aSimpleWriter
.- Parameters:
wri
- the writer.href
- the URI.- Throws:
IOException
- if an I/O problem happens while writing to theSimpleWriter
.
-
writeValue
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.
-
writeMinifiedValue
default void writeMinifiedValue(SimpleWriter wri, String propertyName, CSSValue value) throws IOException 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.
-