public class CssRuleImpl extends java.lang.Object implements CssRule
Constructor and Description |
---|
CssRuleImpl(java.lang.String selector,
boolean indent)
Construct a CSS rule
|
CssRuleImpl(java.lang.String selector,
java.util.Set<CssDeclaration> declarations,
boolean beautify)
Construct a CSS rule
|
Modifier and Type | Method and Description |
---|---|
void |
addDeclaration(CssDeclaration declaraion)
Add a single CSS Declaration
|
java.util.Set<CssDeclaration> |
getDeclarations()
Get CSS Declarations as a Set
|
java.lang.String |
getSelector()
Get the CSS Selector
|
void |
setDeclarations(java.util.Set<CssDeclaration> declarations)
Set all CSS Declarations from a Set
|
void |
setSelector(java.lang.String selector)
Set the CSS Selector
|
java.lang.String |
toCss()
Get the Rule as a CSS string.
|
public CssRuleImpl(java.lang.String selector, java.util.Set<CssDeclaration> declarations, boolean beautify)
selector
- - Selector of the rule. Pass null to construct a rule without a selector.declarations
- - Declaration for each stylebeautify
- - Should the rule look pretty?public CssRuleImpl(java.lang.String selector, boolean indent)
selector
- - Selector of the rule. Pass null to construct a rule without a selector.indent
- - Should the rule look pretty?public java.lang.String getSelector()
CssRule
getSelector
in interface CssRule
public void setSelector(java.lang.String selector)
CssRule
setSelector
in interface CssRule
public java.util.Set<CssDeclaration> getDeclarations()
CssRule
getDeclarations
in interface CssRule
public void setDeclarations(java.util.Set<CssDeclaration> declarations)
CssRule
setDeclarations
in interface CssRule
public void addDeclaration(CssDeclaration declaraion)
CssRule
addDeclaration
in interface CssRule