com.openhtmltopdf.css.sheet.PropertyDeclaration s for
each unique CSS property name. What properties belong in the set is not
determined, except that multiple entries are resolved into a single set using
cascading rules. The set is cascaded during instantiation, so once you have a
CascadedStyle, the PropertyDeclarations you retrieve from it will have been
resolved following the CSS cascading rules. Note that this class knows
nothing about CSS selector-matching rules. Before creating a CascadedStyle,
you will need to determine which PropertyDeclarations belong in the set--for
example, by matching com.openhtmltopdf.css.sheet.Ruleset s to org.w3c.dom.Document org.w3c.dom.Element s via their selectors. You
can get individual properties by using propertyByName(CSSName) or an
java.util.Iterator of properties with getCascadedPropertyDeclarations(). Check for individual property assignments
using hasProperty(CSSName). A CascadedStyle is immutable, as
properties can not be added or removed from it once instantiated.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | cascadedProperties
Map of PropertyDeclarations, keyed by |
| public static final CascadedStyle | emptyCascadedStyle
Get an empty singleton, used to negate inheritance of properties |
| private String |
| Access | Constructor and Description |
|---|---|
| pack-priv | CascadedStyle(Iterator<PropertyDeclaration>
An Iterator containing PropertyDeclarations in order of
specificity. iter)Constructs a new CascadedStyle, given an |
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public int | |
| public static CascadedStyle | createAnonymousStyle(IdentValue display)
Creates an otherwise empty |
| public static PropertyDeclaration | createLayoutPropertyDeclaration(CSSName cssName, IdentValue display)
Creates a |
| public static CascadedStyle | createLayoutStyle(PropertyDeclaration[]
An array of PropertyDeclaration objects created with
decls)createLayoutPropertyDeclaration(CSSName, IdentValue)Creates a |
| public static CascadedStyle | |
| public static CascadedStyle | createLayoutStyle(CascadedStyle startingPoint, PropertyDeclaration[]
An array of PropertyDeclaration objects created with
decls)createLayoutPropertyDeclaration(CSSName, IdentValue)Creates a |
| public Collection | Returns: Iterator over a set of properly cascaded PropertyDeclarations.Returns an |
| public String | |
| public IdentValue | |
| public boolean | Returns: True if the property is defined in this set.The CSS property name, e.g. "font-family". cssName)Returns true if property has been defined in this style. |
| public PropertyDeclaration | Returns: The PropertyDeclaration, if declared in this set, or null if not found.The CSS property name, e.g. "font-family". cssName)Returns a |
| cascadedProperties | back to summary |
|---|---|
| private final Map<CSSName, PropertyDeclaration> cascadedProperties Map of PropertyDeclarations, keyed by | |
| emptyCascadedStyle | back to summary |
|---|---|
| public static final CascadedStyle emptyCascadedStyle Get an empty singleton, used to negate inheritance of properties | |
| fingerprint | back to summary |
|---|---|
| private String fingerprint | |
| CascadedStyle | back to summary |
|---|---|
| pack-priv CascadedStyle(Iterator<PropertyDeclaration> iter) Constructs a new CascadedStyle, given an
| |
| CascadedStyle | back to summary |
|---|---|
| private CascadedStyle(CascadedStyle startingPoint, Iterator<PropertyDeclaration> props) | |
| CascadedStyle | back to summary |
|---|---|
| private CascadedStyle() Default constructor with no initialization. Don't use this to instantiate the class, as the class is immutable and this will leave it without any properties. | |
| addProperties | back to summary |
|---|---|
| private void addProperties(Iterator<PropertyDeclaration> iter) | |
| countAssigned | back to summary |
|---|---|
| public int countAssigned() | |
| createAnonymousStyle | back to summary |
|---|---|
| public static CascadedStyle createAnonymousStyle(IdentValue display) Creates an otherwise empty | |
| createLayoutPropertyDeclaration | back to summary |
|---|---|
| public static PropertyDeclaration createLayoutPropertyDeclaration(CSSName cssName, IdentValue display) Creates a | |
| createLayoutStyle | back to summary |
|---|---|
| public static CascadedStyle createLayoutStyle(PropertyDeclaration[] decls) Creates a
| |
| createLayoutStyle | back to summary |
|---|---|
| public static CascadedStyle createLayoutStyle(List<PropertyDeclaration> decls) | |
| createLayoutStyle | back to summary |
|---|---|
| public static CascadedStyle createLayoutStyle(CascadedStyle startingPoint, PropertyDeclaration[] decls) Creates a
| |
| getCascadedPropertyDeclarations | back to summary |
|---|---|
| public Collection Returns an
| |
| getFingerprint | back to summary |
|---|---|
| public String getFingerprint() | |
| getIdent | back to summary |
|---|---|
| public IdentValue getIdent(CSSName cssName) Gets the ident attribute of the CascadedStyle object
| |
| hasProperty | back to summary |
|---|---|
| public boolean hasProperty(CSSName cssName) Returns true if property has been defined in this style.
| |
| propertyByName | back to summary |
|---|---|
| public PropertyDeclaration propertyByName(CSSName cssName) Returns a
| |