public class JIdentifier extends JExpr
Modifier and Type | Class and Description |
---|---|
static class |
JIdentifier.IdType |
JExpr.AllocationExpr, JExpr.ArrayIndexExpr, JExpr.CastExpr
Constructor and Description |
---|
JIdentifier()
Creates a new identifier.
|
JIdentifier(JType aType)
Creates a new identifier for given JType: this probably needs to go!
|
JIdentifier(java.lang.String aName)
Creates a new identifier for given value.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getClassNameImpl()
Tries to resolve the class name for this node.
|
JIdentifier.IdType |
getIdentifierType()
Returns the Identifier type: Variable, Field, Class or Package (tries to resolve it if unknown).
|
JMethodCall |
getMethodCall()
Returns the method call if parent is method call.
|
JMethodDecl |
getMethodDecl()
Returns the method declaration if parent is method declaration.
|
java.lang.String |
getNodeString()
Returns the part name.
|
java.util.List<JNode> |
getOthers()
Returns a list of other ids for this id.
|
java.lang.String |
getPackageName()
Returns the full package name for this package identifier.
|
JVariableDecl |
getVariableDecl()
Returns the Identifier variable declaration.
|
boolean |
isClassName()
Returns whether this is Class identifier.
|
boolean |
isFieldName()
Returns whether this is ClassField identifier.
|
boolean |
isMethodName()
Returns whether this identifier is a method name.
|
boolean |
isPackageName()
Returns whether this is package identifier.
|
boolean |
isVariableId()
Returns whether this is variable identifier.
|
void |
setName(java.lang.String aName)
Sets the name for Identifier or Method.
|
protected void |
setPackageName(java.lang.String aName)
Returns the full package name for this package identifier.
|
void |
setVariableDecl(JVariableDecl aVarDecl)
Sets the Identifier variable declaration.
|
getParentClassRef, getParentExpr
addChild, buildChildren, getBlock, getChild, getChildCount, getChildren, getClassLoader, getClassName, getClassRef, getClassRefImpl, getEnclosingClassDecl, getEnclosingMemberDecl, getEnclosingMethodDecl, getEnd, getEndToken, getFile, getJClass, getLineIndex, getName, getNameImpl, getNodeAtCharIndex, getNodeFields, getNodeFieldsImpl, getNodeParents, getNodePath, getParent, getParent, getReferencedClasses, getReferencedClassNames, getReferencedClassNames, getReferencedClassNames, getStart, getStartToken, getString, getVariableDecl, getVariableDeclInside, getVariableDecls, isBlock, setClassName, setClassRef, setEndToken, setJClass, setParent, setStartToken, toString
public JIdentifier()
public JIdentifier(java.lang.String aName)
public JIdentifier(JType aType)
public void setName(java.lang.String aName)
public JIdentifier.IdType getIdentifierType()
public boolean isVariableId()
public boolean isClassName()
public boolean isFieldName()
public boolean isMethodName()
public JMethodCall getMethodCall()
public JMethodDecl getMethodDecl()
public boolean isPackageName()
public java.lang.String getPackageName()
protected void setPackageName(java.lang.String aName)
public JVariableDecl getVariableDecl()
public void setVariableDecl(JVariableDecl aVarDecl)
protected java.lang.String getClassNameImpl()
getClassNameImpl
in class JNode
public java.lang.String getNodeString()
getNodeString
in class JNode