public class ChainVariable
extends java.lang.Object
ChainContext
: actual variable name is assigned here
4. Usage in code generation: getName()/getType()/isFinal() could be called.Modifier and Type | Field and Description |
---|---|
static ChainVariable |
STUB |
Constructor and Description |
---|
ChainVariable(PsiType type) |
ChainVariable(PsiType type,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addBestNameCandidate(java.lang.String candidate)
Register best name candidate for this variable (like lambda argument which was explicitly present in the original code).
|
java.lang.String |
getDeclaration() |
java.lang.String |
getDeclaration(java.lang.String initializer) |
java.lang.String |
getName() |
PsiType |
getType() |
boolean |
isFinal() |
boolean |
isRegistered() |
void |
markFinal()
Call if the resulting variable must be declared final (e.g.
|
void |
register(ChainContext context)
Register variable within
ChainContext . |
java.lang.String |
toString() |
public static final ChainVariable STUB
public ChainVariable(PsiType type)
public ChainVariable(PsiType type, java.lang.String name)
public void markFinal()
public void addBestNameCandidate(java.lang.String candidate)
candidate
- name candidatepublic void register(ChainContext context)
ChainContext
.
Must be called once after all name candidates are registered. Now variable gets an actual name.context
- context to usepublic java.lang.String getName()
public PsiType getType()
public java.lang.String getDeclaration()
public java.lang.String getDeclaration(java.lang.String initializer)
public boolean isFinal()
public boolean isRegistered()
public java.lang.String toString()
toString
in class java.lang.Object