| java.lang.Object org.incava.java.SimpleNodeUtil
All known Subclasses: org.incava.java.ThrowsUtil, org.incava.java.ItemUtil, org.incava.java.ParameterUtil, org.incava.java.FunctionUtil, org.incava.java.TypeDeclarationUtil, org.incava.java.VariableUtil, org.incava.java.FieldUtil, org.incava.java.ClassUtil,
SimpleNodeUtil | public class SimpleNodeUtil (Code) | | Miscellaneous routines for the SimpleNode.
|
Method Summary | |
public static void | dump(SimpleNode node, String prefix) | public static void | dump(SimpleNode node, String prefix, boolean showWhitespace) | public static SimpleNode | findChild(SimpleNode parent, Class childType) | public static SimpleNode | findChild(SimpleNode parent, Class childType, int index) | public static SimpleNode[] | findChildren(SimpleNode parent, Class childType) | public static SimpleNode[] | findChildren(SimpleNode parent) Returns all children of the node. | public static Token | findToken(SimpleNode node, int tokenType) | public static List | getChildren(SimpleNode node) Returns a list of children, both nodes and tokens. | public static List | getChildren(SimpleNode node, boolean getNodes, boolean getTokens) Returns a list of children, optionally nodes and tokens. | public static List | getChildrenSerially(SimpleNode node) Returns a list of child tokens, non-hierarchically. | public static List | getChildrenSerially(SimpleNode node, List list) Returns a list of child tokens, non-hierarchically. | public static Token | getLeadingToken(SimpleNode node, int tokenType) Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes). | public static List | getLeadingTokens(SimpleNode node) Returns the tokens preceding the first child of the node. | public static int | getLevel(SimpleNode node) Returns a numeric "level" for the node. | protected static String | getLocation(Token t1, Token t2) | public static SimpleNode | getParent(SimpleNode node) Returns the parent node. | public static List | getTokens(SimpleNode node) Returns the tokens for a node. | public static boolean | hasChildren(SimpleNode node) Returns whether the node has any children. | public static boolean | hasLeadingToken(SimpleNode node, int tokenType) Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes). | public static void | print(SimpleNode node) | public static void | print(SimpleNode node, String prefix) | public static String | toString(SimpleNode node) Returns the token images for the node. |
getChildren | public static List getChildren(SimpleNode node)(Code) | | Returns a list of children, both nodes and tokens.
|
getChildren | public static List getChildren(SimpleNode node, boolean getNodes, boolean getTokens)(Code) | | Returns a list of children, optionally nodes and tokens.
|
getChildrenSerially | public static List getChildrenSerially(SimpleNode node)(Code) | | Returns a list of child tokens, non-hierarchically.
|
getChildrenSerially | public static List getChildrenSerially(SimpleNode node, List list)(Code) | | Returns a list of child tokens, non-hierarchically.
|
getLeadingToken | public static Token getLeadingToken(SimpleNode node, int tokenType)(Code) | | Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes).
|
getLeadingTokens | public static List getLeadingTokens(SimpleNode node)(Code) | | Returns the tokens preceding the first child of the node.
|
getLevel | public static int getLevel(SimpleNode node)(Code) | | Returns a numeric "level" for the node. Zero is public or abstract, one
is protected, two is package, and three is private.
|
hasChildren | public static boolean hasChildren(SimpleNode node)(Code) | | Returns whether the node has any children.
|
hasLeadingToken | public static boolean hasLeadingToken(SimpleNode node, int tokenType)(Code) | | Returns whether the node has a matching token, occurring prior to any
non-tokens (i.e., before any child nodes).
|
|
|