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

public class ColorDeclarationFormattingContext extends DefaultDeclarationFormattingContext
DeclarationFormattingContext that allows customization of serialized colors.
See Also:
  • Constructor Details

    • ColorDeclarationFormattingContext

      public ColorDeclarationFormattingContext()
  • Method Details

    • writeValue

      public void writeValue(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSValue value) throws IOException
      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(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSColorValue value) throws IOException
      Write a css COLOR 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(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSColorMixFunction value) throws IOException
      Write a css COLOR_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(io.sf.carte.util.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(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSColorValue value) throws IOException
      Write a minified css COLOR 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(io.sf.carte.util.SimpleWriter wri, String propertyName, CSSColorMixFunction value) throws IOException
      Write a minified css COLOR_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.