Class StyleValue

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

public abstract class StyleValue extends Object implements ExtendedCSSValue, Cloneable
Base implementation for CSS values.
  • Constructor Details

    • StyleValue

      protected StyleValue(short valueType)
    • StyleValue

      protected StyleValue(StyleValue copied)
  • 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
      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.
    • getCssValueType

      public short getCssValueType()
      Gives a code defining the type of the value as defined by CSSValue .
      Specified by:
      getCssValueType in interface CSSValue
      Returns:
      the value type according to CSS DOM Level 2.
    • getMinifiedCssText

      public String getMinifiedCssText(String propertyName)
      Description copied from interface: ExtendedCSSValue
      Gives a minified version of the css text of the property, for the given property name.
      Specified by:
      getMinifiedCssText in interface ExtendedCSSValue
      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.
    • 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: ExtendedCSSValue
      Creates and returns a copy of this value.
      Specified by:
      clone in interface ExtendedCSSValue
      Overrides:
      clone in class Object
      Returns:
      a clone of this value.