Top Description Fields Constructors Methods
bsh

pack-priv Class LHS

extends Object
implements ParserConstants, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, bsh.ParserConstants
Imports
java.lang.reflect.Field, java.util.Hashtable

An LHS is a wrapper for an variable, field, or property. It ordinarily holds the "left hand side" of an assignment and may be either resolved to a value or assigned a value.

There is one special case here termed METHOD_EVAL where the LHS is used in an intermediate evaluation of a chain of suffixes and wraps a method invocation. In this case it may only be resolved to a value and cannot be assigned. (You can't assign a value to the result of a method call e.g. "foo() = 5;").

Field Summary

Modifier and TypeField and Description
pack-priv static final int
FIELD

Identifiers for the various types of LHS.

pack-priv Field
pack-priv static final int
INDEX

Identifiers for the various types of LHS.

pack-priv int
pack-priv boolean
localVar

The assignment should be to a local variable

pack-priv static final int
METHOD_EVAL

Identifiers for the various types of LHS.

pack-priv NameSpace
pack-priv Object
pack-priv static final int
PROPERTY

Identifiers for the various types of LHS.

pack-priv String
pack-priv int
pack-priv static final int
VARIABLE

Identifiers for the various types of LHS.

pack-priv String

Constructor Summary

AccessConstructor and Description
pack-priv
LHS(NameSpace nameSpace, String varName, boolean
if true the variable is set directly in the This reference's local scope. If false recursion to look for the variable definition in parent's scope is allowed. (e.g. the default case for undefined vars going to global).
localVar
)

pack-priv
LHS(Field field)

Static field LHS Constructor.

pack-priv
LHS(Object object, Field field)

Object field LHS Constructor.

pack-priv
LHS(Object object, String propName)

Object property LHS Constructor.

pack-priv
LHS(Object array, int index)

Array index LHS Constructor.

Method Summary

Modifier and TypeMethod and Description
public Object
assign(Object val, boolean strictJava)

Assign a value to the LHS.

public Object
public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

FIELDback to summary
pack-priv static final int FIELD

Identifiers for the various types of LHS.

fieldback to summary
pack-priv Field field
INDEXback to summary
pack-priv static final int INDEX

Identifiers for the various types of LHS.

indexback to summary
pack-priv int index
localVarback to summary
pack-priv boolean localVar

The assignment should be to a local variable

METHOD_EVALback to summary
pack-priv static final int METHOD_EVAL

Identifiers for the various types of LHS.

nameSpaceback to summary
pack-priv NameSpace nameSpace
objectback to summary
pack-priv Object object
PROPERTYback to summary
pack-priv static final int PROPERTY

Identifiers for the various types of LHS.

propNameback to summary
pack-priv String propName
typeback to summary
pack-priv int type
VARIABLEback to summary
pack-priv static final int VARIABLE

Identifiers for the various types of LHS.

varNameback to summary
pack-priv String varName

Constructor Detail

LHSback to summary
pack-priv LHS(NameSpace nameSpace, String varName, boolean localVar)
Parameters
localVar:boolean

if true the variable is set directly in the This reference's local scope. If false recursion to look for the variable definition in parent's scope is allowed. (e.g. the default case for undefined vars going to global).

LHSback to summary
pack-priv LHS(Field field)

Static field LHS Constructor. This simply calls Object field constructor with null object.

LHSback to summary
pack-priv LHS(Object object, Field field)

Object field LHS Constructor.

LHSback to summary
pack-priv LHS(Object object, String propName)

Object property LHS Constructor.

LHSback to summary
pack-priv LHS(Object array, int index)

Array index LHS Constructor.

Method Detail

assignback to summary
public Object assign(Object val, boolean strictJava) throws UtilEvalError

Assign a value to the LHS.

getValueback to summary
public Object getValue() throws UtilEvalError
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.