Class 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
      cssText - the text value.
      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
      propertyName - the property name.
      the minified css text.
    • isPrimitiveValue

      public boolean isPrimitiveValue()
      Check whether this value is primitive, that is, either a TYPED or PROXY value.
      true if the value is TYPED or PROXY.
    • isSubproperty

      public boolean isSubproperty()
      Is this a subproperty that has been set by a shorthand?
      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.

      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
      syntax - the syntax.
      the matching for the syntax.
    • hashCode

      public int hashCode()
      hashCode in class Object
    • equals

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

      public String toString()
      toString in class Object
    • getCssText

      public abstract String getCssText()
      Get a string representation of the current value.
      Specified by:
      getCssText in interface CSSValue
      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
      clone in class Object
      a clone of this value.