Package io.sf.carte.doc.style.css
Interface DeclarationFormattingContext
- All Known Subinterfaces:
StyleFormattingContext
- All Known Implementing Classes:
DefaultDeclarationFormattingContext
,DefaultStyleFormattingContext
,InlineStyleFormattingContext
,RGBColorDeclarationFormattingContext
public interface DeclarationFormattingContext
Define methods for formatting properties or descriptors in a declaration,
generally for a computed style.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endPropertyDeclaration
(io.sf.carte.util.SimpleWriter wri) Ends a property declaration in a rule style (does not apply to inline styles).void
startPropertyDeclaration
(io.sf.carte.util.SimpleWriter wri) Starts a property declaration in a rule style (does not apply to inline styles).void
writeColon
(io.sf.carte.util.SimpleWriter wri) Serialize a colon to aSimpleWriter
.void
writeComma
(io.sf.carte.util.SimpleWriter wri) Serialize a comma to aSimpleWriter
.void
writeFullIndent
(io.sf.carte.util.SimpleWriter wri) Serialize a full paragraph indent to aSimpleWriter
.default void
writeMinifiedValue
(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSValue value) Write a minified css value to the given writer.void
writeSemiColon
(io.sf.carte.util.SimpleWriter wri) Serialize a semicolon to aSimpleWriter
.void
Serialize a URL/URI to aSimpleWriter
.default void
writeValue
(io.sf.carte.util.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
default void writeValue(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSValue value) throws IOException 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(io.sf.carte.util.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.
-