public class CSSDocument extends SourceLocation implements ICSSDocument
| Modifier and Type | Field and Description |
|---|---|
protected List<ICSSNode> |
children
A list of children nodes.
|
UNKNOWN| Modifier | Constructor and Description |
|---|---|
protected |
CSSDocument(List<CSSRule> rules,
List<CSSNamespaceDefinition> namespaces,
List<CSSFontFace> fontFaces,
org.antlr.runtime.tree.CommonTree tree,
org.antlr.runtime.TokenStream tokenStream)
Create a root CSS definition.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getArity()
Get the node's child count.
|
com.google.common.collect.ImmutableList<ICSSNamespaceDefinition> |
getAtNamespaces() |
ICSSNamespaceDefinition |
getDefaultNamespaceDefinition()
Get the default
ICSSNamespaceDefinition for this CSS document. |
com.google.common.collect.ImmutableList<ICSSFontFace> |
getFontFaces() |
ICSSNamespaceDefinition |
getNamespaceDefinition(String prefix)
Get the
ICSSNamespaceDefinition object from its associated prefix
name. |
ICSSNode |
getNthChild(int index)
Get the node's nth child.
|
CSSModelTreeType |
getOperator()
Get the node's type.
|
com.google.common.collect.ImmutableList<ICSSRule> |
getRules() |
static CSSDocument |
parse(org.antlr.runtime.CharStream input,
Collection<ICompilerProblem> problems)
Parse a CSS document into
ICSSDocument model. |
String |
toString()
Displays line, column, start, end, and sourcepath in a format such as
"17:5 160-188 C:\test.as"
|
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, getStartprotected CSSDocument(List<CSSRule> rules, List<CSSNamespaceDefinition> namespaces, List<CSSFontFace> fontFaces, org.antlr.runtime.tree.CommonTree tree, org.antlr.runtime.TokenStream tokenStream)
rules - CSS rulesnamespaces - @namespace statementsfontFaces - @font-face statementstree - root of the ASTpublic static CSSDocument parse(org.antlr.runtime.CharStream input, Collection<ICompilerProblem> problems)
ICSSDocument model.input - ANTLR input stream. The CharStream#getSourceName()
must be implemented in order to make source location work.problems - Parsing problems will be aggregated in this collection.public com.google.common.collect.ImmutableList<ICSSRule> getRules()
getRules in interface ICSSDocumentpublic com.google.common.collect.ImmutableList<ICSSNamespaceDefinition> getAtNamespaces()
getAtNamespaces in interface ICSSDocumentpublic String toString()
SourceLocation"17:5 160-188 C:\test.as"
toString in class SourceLocationpublic com.google.common.collect.ImmutableList<ICSSFontFace> getFontFaces()
getFontFaces in interface ICSSDocumentpublic ICSSNamespaceDefinition getNamespaceDefinition(String prefix)
ICSSDocumentICSSNamespaceDefinition object from its associated prefix
name.getNamespaceDefinition in interface ICSSDocumentprefix - namespace prefixICSSNamespaceDefinition mapped to the given prefix.public ICSSNamespaceDefinition getDefaultNamespaceDefinition()
ICSSDocumentICSSNamespaceDefinition for this CSS document.
The default namespace's short name is an empty string "".getDefaultNamespaceDefinition in interface ICSSDocumentpublic 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.