# Class Variable

java.lang.Object
bsh.Variable

All Implemented Interfaces:
  `Serializable`

public class Variable extends Object implements Serializable

See Also:
  - Serialized Form

## Method Summary

Modifier and Type
Method
Description
`Modifiers`
`getModifiers()`
`String`
`getName()`
`Class`
`getType()`
A type of null means loosely typed variable
`String`
`getTypeDescriptor()`
`boolean`
`hasModifier(String name)`
`void`
`setValue(Object value, int context)`
Set the value of the typed variable.
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Method Details

### setValue

public void setValue(Object value, int context) throws UtilEvalError
Set the value of the typed variable.

Parameters:
  `value` - 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.
Throws:
  `UtilEvalError`

### getType

public Class getType()
A type of null means loosely typed variable

### getTypeDescriptor

public String getTypeDescriptor()

### getModifiers

public Modifiers getModifiers()

### getName

public String getName()

### hasModifier

public boolean hasModifier(String name)

### toString

public String toString()

Overrides:
  `toString` in class `Object`