Top Fields Constructors Methods
bsh

public Class Variable

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv LHS
pack-priv Modifiers
pack-priv String
name

A null type means an untyped variable

pack-priv Class<T>
pack-priv String
pack-priv Object

Constructor Summary

AccessConstructor and Description
pack-priv
Variable(String name, Class<T> type, LHS lhs)

pack-priv
Variable(String name, Object value, Modifiers modifiers)

pack-priv
Variable(String name, String typeDescriptor, Object value, Modifiers modifiers)

This constructor is used in class generation.

pack-priv
Variable(String name, Class<T> type, Object
may be null if this
value
,
Modifiers modifiers)

Method Summary

Modifier and TypeMethod and Description
public Modifiers
public String
public Class<T>
getType()

A type of null means loosely typed variable

public String
pack-priv Object
public boolean
public void
setValue(Object
should be an object or wrapped bsh Primitive type. if value is null the appropriate default value will be set for the type: e.g. false for boolean, zero for integer types.
value
,
int context)

Set the value of the typed variable.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ASSIGNMENTback to summary
pack-priv static final int ASSIGNMENT
DECLARATIONback to summary
pack-priv static final int DECLARATION
lhsback to summary
pack-priv LHS lhs
modifiersback to summary
pack-priv Modifiers modifiers
nameback to summary
pack-priv String name

A null type means an untyped variable

typeback to summary
pack-priv Class<T> type
typeDescriptorback to summary
pack-priv String typeDescriptor
valueback to summary
pack-priv Object value

Constructor Detail

Variableback to summary
pack-priv Variable(String name, Class<T> type, LHS lhs)
Variableback to summary
pack-priv Variable(String name, Object value, Modifiers modifiers) throws UtilEvalError
Variableback to summary
pack-priv Variable(String name, String typeDescriptor, Object value, Modifiers modifiers) throws UtilEvalError

This constructor is used in class generation.

Variableback to summary
pack-priv Variable(String name, Class<T> type, Object value, Modifiers modifiers) throws UtilEvalError
Parameters
value:Object

may be null if this

Method Detail

getModifiersback to summary
public Modifiers getModifiers()
getNameback to summary
public String getName()
getTypeback to summary
public Class<T> getType()

A type of null means loosely typed variable

getTypeDescriptorback to summary
public String getTypeDescriptor()
getValueback to summary
pack-priv Object getValue() throws UtilEvalError
hasModifierback to summary
public boolean hasModifier(String name)
setValueback to summary
public void setValue(Object value, int context) throws UtilEvalError

Set the value of the typed variable.

Parameters
value:Object

should be an object or wrapped bsh Primitive type. if value is null the appropriate default value will be set for the type: e.g. false for boolean, zero for integer types.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.