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 TypeMethodDescriptionvoidendPropertyDeclaration(io.sf.carte.util.SimpleWriter wri) Ends a property declaration in a rule style (does not apply to inline styles).voidstartPropertyDeclaration(io.sf.carte.util.SimpleWriter wri) Starts a property declaration in a rule style (does not apply to inline styles).voidwriteColon(io.sf.carte.util.SimpleWriter wri) Serialize a colon to aSimpleWriter.voidwriteComma(io.sf.carte.util.SimpleWriter wri) Serialize a comma to aSimpleWriter.voidwriteFullIndent(io.sf.carte.util.SimpleWriter wri) Serialize a full paragraph indent to aSimpleWriter.default voidwriteMinifiedValue(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSValue value) Write a minified css value to the given writer.voidwriteSemiColon(io.sf.carte.util.SimpleWriter wri) Serialize a semicolon to aSimpleWriter.voidSerialize a URL/URI to aSimpleWriter.default voidwriteValue(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.
-