public final class NodeUtil extends Object
Modifier and Type | Method and Description |
---|---|
static JSDocInfo |
getFunctionJSDocInfo(Node n)
Get the JSDocInfo for a function.
|
static Node |
getFunctionParameters(Node fnNode) |
static InputId |
getInputId(Node n) |
static String |
getNearestFunctionName(Node n)
Gets the function's name.
|
static StaticSourceFile |
getSourceFile(Node n) |
static String |
getSourceName(Node n) |
static boolean |
isLValue(Node n)
Determines whether this node is used as an L-value.
|
static TernaryValue |
isStrWhiteSpaceChar(int c)
Copied from Rhino's ScriptRuntime
|
static boolean |
isValidQualifiedName(String name)
Determines whether the given name is a valid qualified name.
|
static Node |
newQualifiedNameNode(CodingConvention convention,
String name)
Creates a node representing a qualified name.
|
public static TernaryValue isStrWhiteSpaceChar(int c)
public static String getNearestFunctionName(Node n)
{'name': function() ...}
{name: function() ...}
function name() ...
var name = function() ...
qualified.name = function() ...
var name2 = function name1() ...
qualified.name2 = function name1() ...
n
- a node whose type is Token.FUNCTION
null
if it has no namepublic static boolean isLValue(Node n)
n
- The nodepublic static Node newQualifiedNameNode(CodingConvention convention, String name)
name
- A qualified name (e.g. "foo" or "foo.bar.baz")public static boolean isValidQualifiedName(String name)
public static Node getFunctionParameters(Node fnNode)
fnNode
- The function.public static JSDocInfo getFunctionJSDocInfo(Node n)
public static String getSourceName(Node n)
n
- The node.public static StaticSourceFile getSourceFile(Node n)
n
- The node.