Class StyleValue

java.lang.Object
io.sf.carte.doc.style.css.property.StyleValue
All Implemented Interfaces:
CSSValue, Serializable, Cloneable
Direct Known Subclasses:
KeywordValue, PrimitiveValue, ValueList

public abstract class StyleValue extends Object implements CSSValue, Cloneable, Serializable
Base implementation for CSS values.
See Also:
  • Constructor Details

    • StyleValue

      protected StyleValue()
  • Method Details

    • setCssText

      public void setCssText(String cssText) throws DOMException
      Attempts to change this value to match the supplied css text.

      In css4j, it is not recommended to set property values using this method.

      Specified by:
      setCssText in interface CSSValue
      Parameters:
      cssText - the text value.
      Throws:
      DOMException - SYNTAX_ERR: Raised if the specified CSS string value has a syntax error (according to the attached property) or is unparsable.
      INVALID_MODIFICATION_ERR: Raised if the specified CSS string value represents a different type of values than the values allowed by the CSS property.
      NO_MODIFICATION_ALLOWED_ERR: Raised if this value is read-only.
    • getMinifiedCssText

      public String getMinifiedCssText(String propertyName)
      Description copied from interface: CSSValue
      Gives a minified version of the css text of the property.

      It may be customized for the given property name.

      Specified by:
      getMinifiedCssText in interface CSSValue
      Parameters:
      propertyName - the property name.
      Returns:
      the minified css text.
    • isSubproperty

      public boolean isSubproperty()
      Is this a subproperty that has been set by a shorthand?
      Returns:
      true if this a subproperty that has been set by a shorthand, false otherwise.
    • isSystemDefault

      public boolean isSystemDefault()
      Is this value a wildcard for a system-dependent default?

      If that is the case, it cannot be used to compute values.

      Returns:
      true if this is a placeholder for a system-dependent default, false otherwise.
    • matches

      public CSSValueSyntax.Match matches(CSSValueSyntax syntax)
      Verify if this value matches the given grammar.
      Specified by:
      matches in interface CSSValue
      Parameters:
      syntax - the syntax.
      Returns:
      the matching for the syntax.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCssText

      public abstract String getCssText()
      Get a string representation of the current value.
      Specified by:
      getCssText in interface CSSValue
      Returns:
      the css text representing the value of this property.
    • clone

      public abstract StyleValue clone()
      Description copied from interface: CSSValue
      Creates and returns a copy of this value.
      Specified by:
      clone in interface CSSValue
      Overrides:
      clone in class Object
      Returns:
      a clone of this value.