public class NameLogic extends Object
Constructor and Description |
---|
NameLogic() |
Modifier and Type | Method and Description |
---|---|
static NameCategory |
classifyReference(com.github.javaparser.ast.Node name,
TypeSolver typeSolver) |
static NameRole |
classifyRole(com.github.javaparser.ast.Node name)
What is the Role of the given name? Does it represent a Declaration or a Reference?
|
static boolean |
isAName(com.github.javaparser.ast.Node node)
Does the Node represent a Name?
|
static boolean |
isQualifiedName(com.github.javaparser.ast.Node node)
Is the given node a qualified name?
|
static boolean |
isSimpleName(com.github.javaparser.ast.Node node)
Is the given node a non-qualified name?
|
static String |
nameAsString(com.github.javaparser.ast.Node name)
Return the string representation of the name
|
static NameCategory |
syntacticClassificationAccordingToContext(com.github.javaparser.ast.Node name)
See JLS 6.5.1 Syntactic Classification of a Name According to Context.
|
public static boolean isSimpleName(com.github.javaparser.ast.Node node)
IllegalArgumentException
- if the node is not a namepublic static boolean isQualifiedName(com.github.javaparser.ast.Node node)
IllegalArgumentException
- if the node is not a namepublic static boolean isAName(com.github.javaparser.ast.Node node)
Note that while most specific AST classes either always represent names or never represent names there are exceptions as the FieldAccessExpr
public static NameRole classifyRole(com.github.javaparser.ast.Node name)
This classification is purely syntactical, i.e., it does not require symbol resolution. For this reason in the future this could be moved to the core module of JavaParser.
public static NameCategory classifyReference(com.github.javaparser.ast.Node name, TypeSolver typeSolver)
public static NameCategory syntacticClassificationAccordingToContext(com.github.javaparser.ast.Node name)
Most users do not want to call directly this method but call classifyReference instead.
public static String nameAsString(com.github.javaparser.ast.Node name)
Copyright © 2007–2020. All rights reserved.