public class CSSRule extends SourceLocation implements ICSSRule
| Modifier and Type | Field and Description |
|---|---|
protected List<ICSSNode> |
children
A list of children nodes.
|
UNKNOWN| Constructor and Description |
|---|
CSSRule(List<CSSMediaQueryCondition> mediaQueries,
List<CSSSelector> selectorGroup,
List<CSSProperty> properties,
org.antlr.runtime.tree.CommonTree tree,
org.antlr.runtime.TokenStream tokenStream) |
| Modifier and Type | Method and Description |
|---|---|
int |
getArity()
Get the node's child count.
|
com.google.common.collect.ImmutableList<ICSSMediaQueryCondition> |
getMediaQueryConditions()
Get a list of media query conditions associated with this CSS rule.
|
ICSSNode |
getNthChild(int index)
Get the node's nth child.
|
CSSModelTreeType |
getOperator()
Get the node's type.
|
com.google.common.collect.ImmutableList<ICSSProperty> |
getProperties()
Get the CSS properties in their declared order.
|
com.google.common.collect.ImmutableList<ICSSSelector> |
getSelectorGroup()
Get all the subjects in the selector group in their declared order.
|
String |
toString()
Print out a rule in Flex CSS syntax.
|
String |
toStringTree()
Recursively print out the text representation of the tree.
|
getAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getLineColumnString, getOffsetsString, getSourcePath, getSourcePathString, getStart, setColumn, setEnd, setEndColumn, setEndLine, setLine, setSourceLocation, setSourcePath, setStart, span, spanclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetArity, getNthChild, getOperator, toStringTreegetAbsoluteEnd, getAbsoluteStart, getColumn, getEnd, getEndColumn, getEndLine, getLine, getSourcePath, getStartpublic CSSRule(List<CSSMediaQueryCondition> mediaQueries, List<CSSSelector> selectorGroup, List<CSSProperty> properties, org.antlr.runtime.tree.CommonTree tree, org.antlr.runtime.TokenStream tokenStream)
public com.google.common.collect.ImmutableList<ICSSMediaQueryCondition> getMediaQueryConditions()
ICSSRulegetMediaQueryConditions in interface ICSSRuleICSSMediaQueryCondition objects; Null if the
rule is not enclosed in a media query.public com.google.common.collect.ImmutableList<ICSSSelector> getSelectorGroup()
ICSSRuleA CSS rule can have one or many selectors separated by comma(s). Each selector has a subject.
The element of the right most simple selector in an
ICSSSelector is the subject of the current selector
object.
Example: selector subject.
Subject for "s|HBox s|Button.round s|Label.dark" is "Label".
Subject for "s|Panel .noskin" is "*". (".noskin" is the
implicit form of "*.noskin").
The subject selector is the root of the combination of simple selectors in this "chain".
Example: selector combination.
A > B C ~ D E
"E" is the subject. Its linked to "D" as descendant; "D" is linked
to "C" as general sibling; "B" is the child of "A".
Starting from the subject, you can walk up the chain right to left.
Example: CSS rule with selector group.
s|HBox .rounded s|Label.big,
s|VBox .rounded s|Label.small { fontWeight:bold; }
The return value for the above rule would be list
[s|Label, s|Label].getSelectorGroup in interface ICSSRulepublic com.google.common.collect.ImmutableList<ICSSProperty> getProperties()
ICSSRulegetProperties in interface ICSSRulepublic String toString()
toString in class SourceLocationpublic String toStringTree()
toStringTree in interface ICSSNodepublic int getArity()
ICSSNodeDefaultAdapter.public ICSSNode getNthChild(int index)
ICSSNodeDefaultAdapter.getNthChild in interface ICSSNodeindex - Child index.public CSSModelTreeType getOperator()
ICSSNodeDefaultAdapter.getOperator in interface ICSSNodeCopyright © 2016 The Apache Software Foundation. All rights reserved.