java.lang.Object
org.xhtmlrenderer.css.sheet.PropertyDeclaration
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.- Author:
- Torbjoern Gannholm, Patrick Wright
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intImportanceAndOrigin of stylesheet - how many different -
Constructor Summary
ConstructorsConstructorDescriptionPropertyDeclaration(CSSName cssName, CSSPrimitiveValue value, boolean imp, StylesheetInfo.Origin orig) Creates a new instance of PropertyDeclaration from anCSSPrimitiveValueinstance. -
Method Summary
Modifier and TypeMethodDescriptionGets the cSSName attribute of the PropertyDeclaration objectintReturns an int representing the combined origin and importance of the property as declared.Returns the CSS name of this property, e.g.getValue()Returns the specifiedCSSValuefor this property.booleantoString()Converts to a String representation of the object.
-
Field Details
-
IMPORTANCE_AND_ORIGIN_COUNT
public static final int IMPORTANCE_AND_ORIGIN_COUNTImportanceAndOrigin of stylesheet - how many different- See Also:
-
-
Constructor Details
-
PropertyDeclaration
public PropertyDeclaration(CSSName cssName, CSSPrimitiveValue value, boolean imp, StylesheetInfo.Origin orig) Creates a new instance of PropertyDeclaration from anCSSPrimitiveValueinstance.- Parameters:
cssName- the name of CSS propertyvalue- The CSSValue to wrapimp- True if property was declared important! and false if not.orig- origin of the property declaration, that is, the origin of the style sheet where it was declared.
-
-
Method Details
-
toString
Converts to a String representation of the object. -
asIdentValue
-
getDeclarationStandardText
-
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 isStylesheetInfo.Origin.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
Returns the CSS name of this property, e.g. "font-family". -
getCSSName
Gets the cSSName attribute of the PropertyDeclaration object- Returns:
- The cSSName value
-
getValue
Returns the specifiedCSSValuefor 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
-