Class 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 node
      void setText​(String sText)  
      void setValue​(Object aValue)  
      String toString()  
      • 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
    • Constructor Detail

      • CSSNode

        public CSSNode​(int nType)
    • Method Detail

      • getId

        public int getId()
        Specified by:
        getId in interface Node
      • 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.
        Specified by:
        jjtOpen in interface Node
      • jjtClose

        public void jjtClose()
        Description copied from interface: Node
        This method is called after all the child nodes have been added.
        Specified by:
        jjtClose in interface Node
      • jjtSetParent

        public void jjtSetParent​(@Nullable
                                 Node aNode)
        Description copied from interface: Node
        Set the parent node of this node
        Specified by:
        jjtSetParent in interface Node
        Parameters:
        aNode - parent node to set
      • jjtAddChild

        public void jjtAddChild​(Node aNode,
                                int nIndex)
        Called from the highest index to the lowest index!
        Specified by:
        jjtAddChild in interface Node
        Parameters:
        aNode - node to add as a child
        nIndex - 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 interface Node
        Parameters:
        nIndex - zero-baeed child index
      • jjtGetNumChildren

        @Nonnegative
        public int jjtGetNumChildren()
        Specified by:
        jjtGetNumChildren in interface Node
        Returns:
        the number of children the node has. Always ≥ 0.
      • jjtSetFirstToken

        public void jjtSetFirstToken​(@Nonnull
                                     Token aFirstToken)
      • jjtSetLastToken

        public void jjtSetLastToken​(@Nonnull
                                    Token aLastToken)
      • getValue

        @Nullable
        public Object getValue()
        Specified by:
        getValue in interface com.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.