public class Rule
extends java.lang.Object
A rule is made of a selector and values. The selector identifies the element(s) this rule applies to, and the values are styles to apply to the matched elements.
Modifier and Type | Field and Description |
---|---|
java.util.HashSet<java.lang.String> |
groups
Optionally, the rule can store all the style groups it participates in.
|
Selector |
selector
The match.
|
Style |
style
The style.
|
Constructor and Description |
---|
Rule(Selector selector)
New rule with a matcher.
|
Rule(Selector selector,
Rule parent) |
Modifier and Type | Method and Description |
---|---|
void |
addGroup(java.lang.String groupId)
Specify that this rule participates in the given style group.
|
java.util.HashSet<java.lang.String> |
getGroups()
The group this rule participate in, maybe null if the rule does not
participate in any group.
|
Style |
getStyle()
This rule style.
|
boolean |
matchId(java.lang.String identifier)
True if this rule selector match the given identifier.
|
void |
removeGroup(java.lang.String groupId)
Remove this rule from the style group.
|
void |
setStyle(Style style)
Change the style.
|
java.lang.String |
toString() |
java.lang.String |
toString(int level) |
public Selector selector
public Style style
public java.util.HashSet<java.lang.String> groups
public Rule(Selector selector)
selector
- The rule selector.public Style getStyle()
public java.util.HashSet<java.lang.String> getGroups()
public boolean matchId(java.lang.String identifier)
identifier
- The identifier to test for the match.public void setStyle(Style style)
style
- A style specification.public void addGroup(java.lang.String groupId)
groupId
- The group unique identifier.public void removeGroup(java.lang.String groupId)
groupId
- The group unique identifier.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int level)