Class DynamicConstantExpr
- java.lang.Object
-
- com.tonic.analysis.source.ast.expr.DynamicConstantExpr
-
- All Implemented Interfaces:
ASTNode,Expression
public final class DynamicConstantExpr extends Object implements Expression
A dynamic constant (condy, Java 11+) whose bootstrap method was not a recognized pattern, preserving the bootstrap information for display.
-
-
Constructor Summary
Constructors Constructor Description DynamicConstantExpr(String name, String descriptor, int bootstrapMethodIndex, SourceType type)Creates a dynamic constant with unknown bootstrap owner, name, and descriptor.DynamicConstantExpr(String name, String descriptor, int bootstrapMethodIndex, String bootstrapOwner, String bootstrapName, String bootstrapDescriptor, SourceType type)Creates a dynamic constant with full bootstrap information; null arguments fall back to placeholders.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(SourceVisitor<T> visitor)Accepts a visitor for this node.StringgetBootstrapDescriptor()intgetBootstrapMethodIndex()StringgetBootstrapName()StringgetBootstrapOwner()StringgetDescriptor()StringgetFormattedBootstrapMethod()SourceLocationgetLocation()Gets the source location of this node.StringgetName()ASTNodegetParent()Gets the parent node in the AST tree.SourceTypegetType()Gets the inferred type of this expression.voidsetParent(ASTNode parent)Sets the parent node in the AST tree.voidsetType(SourceType type)StringtoString()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tonic.analysis.source.ast.ASTNode
deepClone, findAll, findAll, findAncestor, findFirst, findFirst, getChildren, getRoot, isDescendantOf, remove, replaceWith, stream, stream, walk
-
-
-
-
Constructor Detail
-
DynamicConstantExpr
public DynamicConstantExpr(String name, String descriptor, int bootstrapMethodIndex, String bootstrapOwner, String bootstrapName, String bootstrapDescriptor, SourceType type)
Creates a dynamic constant with full bootstrap information; null arguments fall back to placeholders.- Parameters:
name- the constant namedescriptor- the constant type descriptorbootstrapMethodIndex- the index into the BootstrapMethods attributebootstrapOwner- the bootstrap method owner classbootstrapName- the bootstrap method namebootstrapDescriptor- the bootstrap method descriptortype- the inferred source type, or null for Object
-
DynamicConstantExpr
public DynamicConstantExpr(String name, String descriptor, int bootstrapMethodIndex, SourceType type)
Creates a dynamic constant with unknown bootstrap owner, name, and descriptor.- Parameters:
name- the constant namedescriptor- the constant type descriptorbootstrapMethodIndex- the index into the BootstrapMethods attributetype- the inferred source type, or null for Object
-
-
Method Detail
-
getName
public String getName()
- Returns:
- the name
-
getDescriptor
public String getDescriptor()
- Returns:
- the descriptor
-
getBootstrapMethodIndex
public int getBootstrapMethodIndex()
- Returns:
- the bootstrap method index
-
getBootstrapOwner
public String getBootstrapOwner()
- Returns:
- the bootstrap owner
-
getBootstrapName
public String getBootstrapName()
- Returns:
- the bootstrap name
-
getBootstrapDescriptor
public String getBootstrapDescriptor()
- Returns:
- the bootstrap descriptor
-
getType
public SourceType getType()
Description copied from interface:ExpressionGets the inferred type of this expression.- Specified by:
getTypein interfaceExpression- Returns:
- the type
-
setType
public void setType(SourceType type)
- Parameters:
type- the new inferred source type
-
getLocation
public SourceLocation getLocation()
Description copied from interface:ASTNodeGets the source location of this node.- Specified by:
getLocationin interfaceASTNode- Returns:
- the location
-
getParent
public ASTNode getParent()
Description copied from interface:ASTNodeGets the parent node in the AST tree.
-
setParent
public void setParent(ASTNode parent)
Description copied from interface:ASTNodeSets the parent node in the AST tree.
-
accept
public <T> T accept(SourceVisitor<T> visitor)
Description copied from interface:ASTNodeAccepts a visitor for this node.
-
getFormattedBootstrapMethod
public String getFormattedBootstrapMethod()
- Returns:
- the bootstrap method reference as owner.method with dots for slashes
-
-