public class Variable extends AbstractStatement
Note that initialization using LiteralValue
s takes effect immediately,
initialization using Statement
s needs to be deferred to generation time.
Modifier and Type | Method and Description |
---|---|
static Variable |
create(String name,
Class<?> type)
Creates a variable, but does not assign it to a scope.
|
static Variable |
create(String name,
Class<?> type,
Object initialization)
Creates a variable, but does not assign it to a scope.
|
static Variable |
create(String name,
MetaClass type)
Creates a variable, but does not assign it to a scope.
|
static Variable |
create(String name,
MetaClass type,
Object initialization)
Creates a variable, but does not assign it to a scope.
|
static Variable |
create(String name,
Object initialization)
Creates a variable, but does not assign it to a scope.
|
static Variable |
create(String name,
javax.enterprise.util.TypeLiteral<?> type)
Creates a variable, but does not assign it to a scope.
|
static Variable |
create(String name,
javax.enterprise.util.TypeLiteral<?> type,
Object initialization)
Creates a variable, but does not assign it to a scope.
|
static Variable |
createFinal(String name,
Class<?> type)
Creates a variable, but does not assign it to a scope.
|
static Variable |
createFinal(String name,
Class<?> type,
Object initialization)
Creates a variable, but does not assign it to a scope.
|
static Variable |
createFinal(String name,
MetaClass type)
Creates a variable, but does not assign it to a scope.
|
static Variable |
createFinal(String name,
MetaClass type,
Object initialization)
Creates a variable, but does not assign it to a scope.
|
static Variable |
createFinal(String name,
javax.enterprise.util.TypeLiteral<?> type)
Creates a variable, but does not assign it to a scope.
|
static Variable |
createFinal(String name,
javax.enterprise.util.TypeLiteral<?> type,
Object initialization)
Creates a variable, but does not assign it to a scope.
|
boolean |
equals(Object o) |
static Variable |
from(VariableReference ref) |
String |
generate(Context context) |
static VariableReference |
get(String name) |
String |
getName() |
VariableReference |
getReference() |
MetaClass |
getType() |
Statement |
getValue() |
int |
hashCode() |
void |
initialize(Object initializationValue) |
boolean |
isFinal() |
String |
toString() |
public void initialize(Object initializationValue)
public static Variable createFinal(String name, Class<?> type)
Stmt.declareFinalVariable(String, Class)
.name
- The variable nametype
- The variable reference typepublic static Variable createFinal(String name, javax.enterprise.util.TypeLiteral<?> type)
Stmt.declareFinalVariable(String, TypeLiteral)
.name
- The variable nametype
- The variable reference typepublic static Variable createFinal(String name, MetaClass type)
Stmt#declareFinalVariable(String, MetaClass)
.name
- The variable nametype
- The variable reference typepublic static Variable createFinal(String name, Class<?> type, Object initialization)
Stmt.declareFinalVariable(String, Class, Object)
.name
- The variable nametype
- The variable reference typepublic static Variable createFinal(String name, MetaClass type, Object initialization)
Stmt.declareFinalVariable(String, MetaClass, Object)
.name
- The variable nametype
- The variable reference typepublic static Variable createFinal(String name, javax.enterprise.util.TypeLiteral<?> type, Object initialization)
Stmt.declareFinalVariable(String, TypeLiteral, Object)
.name
- The variable nametype
- The variable reference typepublic static Variable create(String name, Object initialization)
Stmt.declareVariable(String, Object)
.name
- The variable nametype
- The variable reference typepublic static Variable from(VariableReference ref)
public static Variable create(String name, Class<?> type)
Stmt.declareVariable(String, Class)
.name
- The variable nametype
- The variable reference typepublic static Variable create(String name, javax.enterprise.util.TypeLiteral<?> type)
Stmt.declareVariable(String, TypeLiteral)
.name
- The variable nametype
- The variable reference typepublic static Variable create(String name, MetaClass type)
Stmt#declareVariable(String, MetaClass)
.name
- The variable nametype
- The variable reference typepublic static Variable create(String name, Class<?> type, Object initialization)
Stmt.declareVariable(String, Class, Object)
.name
- The variable nametype
- The variable reference typepublic static Variable create(String name, javax.enterprise.util.TypeLiteral<?> type, Object initialization)
Stmt.declareVariable(String, TypeLiteral, Object)
.name
- The variable nametype
- The variable reference typepublic static Variable create(String name, MetaClass type, Object initialization)
Stmt.declareVariable(String, MetaClass, Object)
.name
- The variable nametype
- The variable reference typepublic static VariableReference get(String name)
public VariableReference getReference()
public String getName()
public MetaClass getType()
getType
in interface Statement
getType
in class AbstractStatement
public Statement getValue()
public boolean isFinal()
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.