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 voidappendText(String sText)voiddump(String sPrefix)intgetId()intgetNodeType()CSSSourceLocationgetSourceLocation()StringgetText()ObjectgetValue()booleanhasText()Iterator<CSSNode>iterator()voidjjtAddChild(Node aNode, int nIndex)Called from the highest index to the lowest index!voidjjtClose()This method is called after all the child nodes have been added.CSSNodejjtGetChild(int nIndex)This method returns a child node.TokenjjtGetFirstToken()TokenjjtGetLastToken()intjjtGetNumChildren()NodejjtGetParent()voidjjtOpen()This method is called after the node has been made the current node.voidjjtSetFirstToken(Token aFirstToken)voidjjtSetLastToken(Token aLastToken)voidjjtSetParent(Node aNode)Set the parent node of this nodevoidsetText(String sText)voidsetValue(Object aValue)StringtoString()-
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:NodeThis 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:NodeThis method is called after all the child nodes have been added.
-
jjtSetParent
public void jjtSetParent(@Nullable Node aNode)
Description copied from interface:NodeSet the parent node of this node- Specified by:
jjtSetParentin interfaceNode- Parameters:
aNode- parent node to set
-
jjtGetParent
@Nullable public Node jjtGetParent()
- Specified by:
jjtGetParentin interfaceNode- Returns:
- parent node
-
jjtAddChild
public void jjtAddChild(Node aNode, int nIndex)
Called from the highest index to the lowest index!- Specified by:
jjtAddChildin 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:NodeThis method returns a child node. The children are numbered from zero, left to right.- Specified by:
jjtGetChildin interfaceNode- Parameters:
nIndex- zero-baeed child index
-
jjtGetNumChildren
@Nonnegative public int jjtGetNumChildren()
- Specified by:
jjtGetNumChildrenin interfaceNode- Returns:
- the number of children the node has. Always ≥ 0.
-
getValue
@Nullable public Object getValue()
- Specified by:
getValuein 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
nullif neither begin token nor end token is present.
-
-