Class PropertyDeclaration

java.lang.Object
org.xhtmlrenderer.css.sheet.PropertyDeclaration

public class PropertyDeclaration extends Object
Represents a single property declared in a CSS rule set. A PropertyDeclaration is created from an CSSValue and is immutable. The declaration knows its origin, importance and specificity, and thus is prepared to be sorted out among properties of the same name, within a matched group, for the CSS cascade, into a CascadedStyle.
  • Field Details

    • propName

      private final String propName
    • cssName

      private final CSSName cssName
    • cssPrimitiveValue

      private final CSSPrimitiveValue cssPrimitiveValue
    • important

      private final boolean important
      Whether the property was declared as important! by the user.
    • origin

      private final int origin
      Origin constant from the list defined in Stylesheet. See StylesheetInfo.USER_AGENT, StylesheetInfo.USER, and StylesheetInfo.AUTHOR.
    • _identVal

      private IdentValue _identVal
    • identIsSet

      private boolean identIsSet
    • _fingerprint

      private String _fingerprint
    • IMPORTANCE_AND_ORIGIN_COUNT

      public static final int IMPORTANCE_AND_ORIGIN_COUNT
      ImportanceAndOrigin of stylesheet - how many different
      See Also:
    • USER_AGENT

      private static final int USER_AGENT
      ImportanceAndOrigin of stylesheet - user agent
      See Also:
    • USER_NORMAL

      private static final int USER_NORMAL
      ImportanceAndOrigin of stylesheet - user normal
      See Also:
    • AUTHOR_NORMAL

      private static final int AUTHOR_NORMAL
      ImportanceAndOrigin of stylesheet - author normal
      See Also:
    • AUTHOR_IMPORTANT

      private static final int AUTHOR_IMPORTANT
      ImportanceAndOrigin of stylesheet - author important
      See Also:
    • USER_IMPORTANT

      private static final int USER_IMPORTANT
      ImportanceAndOrigin of stylesheet - user important
      See Also:
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Converts to a String representation of the object.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the object.
    • asIdentValue

      public IdentValue asIdentValue()
    • getDeclarationStandardText

      public String getDeclarationStandardText()
    • getFingerprint

      public String getFingerprint()
    • getImportanceAndOrigin

      public int getImportanceAndOrigin()
      Returns an int representing the combined origin and importance of the property as declared. The int is assigned such that default origin and importance is 0, and highest an important! property defined by the user (origin is Stylesheet.USER). The combined value would allow this property to be sequenced in the CSS cascade along with other properties matched to the same element with the same property name. In that sort, the highest sequence number returned from this method would take priority in the cascade, so that a user important! property would override a user non-important! property, and so on. The actual integer value returned by this method is unimportant, but has the lowest value of 0 and increments sequentially by 1 for each increase in origin/importance.
    • getPropertyName

      public String getPropertyName()
      Returns the CSS name of this property, e.g. "font-family".
    • getCSSName

      public CSSName getCSSName()
      Gets the cSSName attribute of the PropertyDeclaration object
      Returns:
      The cSSName value
    • getValue

      public CSSPrimitiveValue getValue()
      Returns the specified CSSValue for this property. Specified means the value as entered by the user. Modifying the CSSValue returned here will result in indeterminate behavior--consider it immutable.
    • isImportant

      public boolean isImportant()
    • getOrigin

      public int getOrigin()