Interface IJavaIdentifier
- All Superinterfaces:
IJavaElement
,IJavaExpression
,IJavaLeftExpression
Java AST interface to represent a Java identifier, or variable.
Example:
int someVariable = 3; ^^^^^^^^^^^^
-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
FLAG_BUILT, FLAG_FIELD_REFERENCES_OUTERCLASS, FLAG_LAMBDA_CLASS, FLAG_LAMBDA_IMPL, FLAG_OPTIONAL_RENDERING, FLAG_SECOND_PARAMETER_IS_OUTER_REF, FLAG_STICKY
-
Method Summary
Modifier and TypeMethodDescriptionDuplicate this element.void
generate
(JavaOutputSink out, boolean definition) Custom AST code generator that allows specifying whether the generation of this identifier is part of its initial definition.Get the identifier's debug name, if any was provided.Get this identifier's definition statement.Retrieve the actual identifier name that would be generated to the provided sink.Retrieve the actual type name that would be generated to the provided sink.getName()
Get the identifier original name.getType()
Get this identifier's type.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
addFlags, addTag, canCauseException, collectAllPhysicalOffsets, generate, getData, getElementType, getFlags, getOrigin, getPhysicalMethodIndex, getPhysicalOffset, getReconAnon, getReconEnum, getReconEnummap, getReconLambda, getSubElements, getTags, hasFlags, hasPhysicalMethodIndex, hasPhysicalOffset, isReconArtifact, removeFlags, removeTag, replaceSubElement, setData, setFlags, setLambdaRecon, setOrigin, setPhysicalMethodIndex, setPhysicalOffset, setReconAnon, setReconEnum, setReconEnummap, toShortString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPre
-
Method Details
-
getDefinition
IJavaDefinition getDefinition()Get this identifier's definition statement.- Returns:
-
getType
IJavaType getType()Get this identifier's type.- Returns:
-
getName
String getName()Get the identifier original name.In order to retrieve the current (effective) name, use
IJavaSourceUnit#getIdentifierName(IJavaIdentifier)
.- Returns:
- the original (not necessarily current) name, never null
-
getDebugName
String getDebugName()Get the identifier's debug name, if any was provided.In order to retrieve the current (effective) name, use
IJavaSourceUnit#getIdentifierName(IJavaIdentifier)
.- Returns:
- the debug name, null if none was provided
-
getGeneratedName
Retrieve the actual identifier name that would be generated to the provided sink.- Parameters:
sink
-- Returns:
-
getGeneratedType
Retrieve the actual type name that would be generated to the provided sink.- Parameters:
sink
-- Returns:
-
duplicate
IJavaIdentifier duplicate()Description copied from interface:IJavaElement
Duplicate this element.- Specified by:
duplicate
in interfaceIJavaElement
- Specified by:
duplicate
in interfaceIJavaExpression
- Specified by:
duplicate
in interfaceIJavaLeftExpression
- Returns:
- a (possibly) duplicated object of the same type
-
generate
Custom AST code generator that allows specifying whether the generation of this identifier is part of its initial definition.- Parameters:
out
-definition
- true if this identifier is generated by its containingIJavaDefinition
element
-