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:
  • Constructor Summary

    Constructors
    Constructor
    Description
    CSSNode(int nType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    dump(String sPrefix)
     
    int
     
    int
     
     
     
     
    boolean
     
     
    void
    jjtAddChild(Node aNode, int nIndex)
    Called from the highest index to the lowest index!
    void
    This method is called after all the child nodes have been added.
    jjtGetChild(int nIndex)
    This method returns a child node.
     
     
    int
     
     
    void
    This method is called after the node has been made the current node.
    void
    jjtSetFirstToken(Token aFirstToken)
     
    void
    jjtSetLastToken(Token aLastToken)
     
    void
    Set the parent node of this node
    void
    setText(String sText)
     
    void
    setValue(Object aValue)
     
     

    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
  • Constructor Details

    • CSSNode

      public CSSNode(int nType)
  • Method Details

    • 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
    • jjtGetParent

      @Nullable public Node jjtGetParent()
      Specified by:
      jjtGetParent in interface Node
      Returns:
      parent node
    • 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.
    • jjtGetFirstToken

      @Nullable public Token jjtGetFirstToken()
    • jjtSetFirstToken

      public void jjtSetFirstToken(@Nonnull Token aFirstToken)
    • jjtGetLastToken

      @Nullable public Token jjtGetLastToken()
    • jjtSetLastToken

      public void jjtSetLastToken(@Nonnull Token aLastToken)
    • setValue

      public void setValue(@Nullable Object aValue)
    • getValue

      @Nullable public Object getValue()
      Specified by:
      getValue in interface com.helger.commons.traits.IGetterDirectTrait
    • setText

      public void setText(@Nullable String sText)
    • appendText

      public void appendText(@Nonnull String sText)
    • getText

      @Nullable public String getText()
    • hasText

      public boolean hasText()
    • getNodeType

      public int getNodeType()
    • iterator

      @Nonnull public Iterator<CSSNode> iterator()
      Specified by:
      iterator in interface Iterable<CSSNode>
    • getSourceLocation

      @Nullable public CSSSourceLocation getSourceLocation()
      Returns:
      The source location of this node. May be null if neither begin token nor end token is present.
    • dump

      public void dump(@Nonnull String sPrefix)
    • toString

      public String toString()
      Overrides:
      toString in class Object