Package com.helger.css.parser
Class CSSNode
- java.lang.Object
-
- com.helger.css.parser.CSSNode
-
- All Implemented Interfaces:
com.helger.commons.collection.impl.ICommonsIterable<CSSNode>
,com.helger.commons.traits.IGetterDirectTrait
,Node
,Serializable
,Iterable<CSSNode>
public class CSSNode extends Object implements Node, com.helger.commons.collection.impl.ICommonsIterable<CSSNode>, com.helger.commons.traits.IGetterDirectTrait
This class represents a simple node in the tree built by jjtree. It's a customized version of the default JJTree Node.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CSSNode(int nType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendText(String sText)
void
dump(String sPrefix)
int
getId()
int
getNodeType()
CSSSourceLocation
getSourceLocation()
String
getText()
Object
getValue()
boolean
hasText()
Iterator<CSSNode>
iterator()
void
jjtAddChild(Node aNode, int nIndex)
Called from the highest index to the lowest index!void
jjtClose()
This method is called after all the child nodes have been added.CSSNode
jjtGetChild(int nIndex)
This method returns a child node.Token
jjtGetFirstToken()
Token
jjtGetLastToken()
int
jjtGetNumChildren()
Node
jjtGetParent()
void
jjtOpen()
This method is called after the node has been made the current node.void
jjtSetFirstToken(Token aFirstToken)
void
jjtSetLastToken(Token aLastToken)
void
jjtSetParent(Node aNode)
Set the parent node of this nodevoid
setText(String sText)
void
setValue(Object aValue)
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsIterable
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCount, getCount
-
Methods inherited from interface com.helger.commons.traits.IGetterDirectTrait
getAsBigDecimal, getAsBigDecimal, getAsBigInteger, getAsBigInteger, getAsBoolean, getAsBoolean, getAsBooleanObj, getAsByte, getAsByte, getAsByteArray, getAsByteObj, getAsChar, getAsChar, getAsCharArray, getAsCharArray, getAsCharObj, getAsDouble, getAsDouble, getAsDoubleObj, getAsFloat, getAsFloat, getAsFloatObj, getAsInt, getAsInt, getAsIntObj, getAsLocalDate, getAsLocalDate, getAsLocalDateTime, getAsLocalDateTime, getAsLocalTime, getAsLocalTime, getAsLong, getAsLong, getAsLongObj, getAsShort, getAsShort, getAsShortObj, getAsSqlBlob, getAsSqlClob, getAsSqlDate, getAsSqlNClob, getAsSqlRowId, getAsSqlTime, getAsSqlTimestamp, getAsString, getAsString, getCastedValue, getCastedValue, getCastedValue, getCastedValue, getConvertedValue, getConvertedValue, getValueClass, hasNoValue, hasValue
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
jjtOpen
public void jjtOpen()
Description copied from interface:Node
This method is called after the node has been made the current node. It indicates that child nodes can now be added to it.
-
jjtClose
public void jjtClose()
Description copied from interface:Node
This method is called after all the child nodes have been added.
-
jjtSetParent
public void jjtSetParent(@Nullable Node aNode)
Description copied from interface:Node
Set the parent node of this node- Specified by:
jjtSetParent
in interfaceNode
- Parameters:
aNode
- parent node to set
-
jjtGetParent
@Nullable public Node jjtGetParent()
- Specified by:
jjtGetParent
in interfaceNode
- Returns:
- parent node
-
jjtAddChild
public void jjtAddChild(Node aNode, int nIndex)
Called from the highest index to the lowest index!- Specified by:
jjtAddChild
in interfaceNode
- Parameters:
aNode
- node to add as a childnIndex
- zero-based index where to add the child
-
jjtGetChild
public CSSNode jjtGetChild(int nIndex)
Description copied from interface:Node
This method returns a child node. The children are numbered from zero, left to right.- Specified by:
jjtGetChild
in interfaceNode
- Parameters:
nIndex
- zero-baeed child index
-
jjtGetNumChildren
@Nonnegative public int jjtGetNumChildren()
- Specified by:
jjtGetNumChildren
in interfaceNode
- Returns:
- the number of children the node has. Always ≥ 0.
-
getValue
@Nullable public Object getValue()
- Specified by:
getValue
in interfacecom.helger.commons.traits.IGetterDirectTrait
-
hasText
public boolean hasText()
-
getNodeType
public int getNodeType()
-
getSourceLocation
@Nullable public CSSSourceLocation getSourceLocation()
- Returns:
- The source location of this node. May be
null
if neither begin token nor end token is present.
-
-