public abstract class LeoScopedObject extends LeoOuterObject
LeoObject.LeoType
NOOUTERS, outers
Constructor and Description |
---|
LeoScopedObject(LeoObject.LeoType type,
Scope scope,
int numberOfOuters) |
Modifier and Type | Method and Description |
---|---|
boolean |
$eq(LeoObject other)
Determines if it equals another object.
|
LeoNativeFunction |
addMethod(Method method)
Adds the Java method into this
LeoScopedObject |
LeoNativeFunction |
addMethod(Object jObject,
Method method)
Adds the Java method into this
LeoScopedObject , if the LeolaMethod annotation is present on the supplied
Method , the LeolaMethod.alias() will be used as the method alias name. |
LeoNativeFunction |
addMethod(Object jObject,
Method method,
String alias)
Adds a native Java method into this
LeoScopedObject |
void |
addProperty(LeoObject member,
LeoObject property)
Adds a data member to this
LeoScopedObject |
NamespaceDefinitions |
getNamespaceDefinitions() |
LeoObject |
getObject(LeoObject key)
Retrieves a property from this object.
|
LeoArray |
getProperties() |
LeoObject |
getProperty(LeoObject member)
Attempts to look up the data member with the supplied name.
|
LeoArray |
getPropertyNames() |
Scope |
getScope() |
boolean |
hasObject(LeoObject key)
Determines if the supplied key has an associated value
|
boolean |
hasProperty(LeoObject member)
Determines if a data member exists in this
Scope or parent scopes |
boolean |
isScopedObject() |
protected LeoObject |
lazyGetProperty(LeoObject member,
Map<String,Method> methods) |
void |
putObject(LeoObject reference,
LeoObject value)
Places the data member in this scope.
|
void |
putObject(String reference,
LeoObject value)
Places the data member in this scope.
|
void |
removeProperty(LeoObject member)
Removes the data member from this
LeoScopedObject |
void |
setObject(LeoObject key,
LeoObject value)
Sets a property on this object.
|
LeoObject |
xgetObject(LeoObject key)
Similar to
LeoObject.getObject(LeoObject) in every way, with the exception that
this will throw a LeolaRuntimeException is the attribute is not found. |
LeoObject |
xgetProperty(LeoObject member)
Attempts to look up the data member with the supplied name.
|
getOuters, isOuter
$add, $add, $add, $add, $band, $band, $band, $band, $bnot, $bor, $bor, $bor, $bor, $bsl, $bsl, $bsl, $bsl, $bsr, $bsr, $bsr, $bsr, $div, $div, $div, $div, $eq, $eq, $eq, $eq, $gt, $gt, $gt, $gt, $gte, $gte, $gte, $gte, $index, $index, $index, $index, $lt, $lt, $lt, $lt, $lte, $lte, $lte, $lte, $mod, $mod, $mod, $mod, $mul, $mul, $mul, $mul, $neg, $neq, $neq, $neq, $neq, $req, $sindex, $sub, $sub, $sub, $sub, $xor, $xor, $xor, $xor, as, as, asByte, asChar, asDouble, asFloat, asInt, asLong, asShort, call, call, call, call, call, call, call, clone, compareTo, equals, getLocals, getNativeMember, getNativeMethod, getNativeMethod, getNumberOfArgs, getObject, getType, getValue, getValue, hasNativeMethod, hasNativeMethod, hasObject, hasVarargs, isArray, isAssignable, isBoolean, isClass, isError, isFunction, isGenerator, isMap, isNamespace, isNativeClass, isNativeFunction, isNull, isNumber, isOfType, isOfType, isOfType, isOfType, isString, isTrue, isTrue, read, removeInterfaceMethods, rethrow, setObject, throwAttributeAccessError, throwAttributeError, throwAttributeError, throwClassNotFoundError, throwDivideByZeroError, throwIfError, throwMethodError, throwNativeMethodError, throwNotImplementedError, toJavaObject, toLeoString, toString, valueOf, write, xcall, xcall, xcall, xcall, xcall, xcall, xcall, xgetObject
public LeoScopedObject(LeoObject.LeoType type, Scope scope, int numberOfOuters)
type
- scope
- public boolean isScopedObject()
isScopedObject
in class LeoObject
public boolean $eq(LeoObject other)
LeoObject
public NamespaceDefinitions getNamespaceDefinitions()
NamespaceDefinitions
within this scopepublic LeoNativeFunction addMethod(Method method)
LeoScopedObject
method
- LeoNativeFunction
that represents the Java methodpublic LeoNativeFunction addMethod(Object jObject, Method method)
LeoScopedObject
, if the LeolaMethod
annotation is present on the supplied
Method
, the LeolaMethod.alias()
will be used as the method alias name.jObject
- method
- LeoNativeFunction
that represents the Java methodpublic LeoNativeFunction addMethod(Object jObject, Method method, String alias)
LeoScopedObject
jObject
- the Java instancemethod
- the Java methodalias
- an alias name for the Java methodLeoNativeFunction
that represents the Java methodpublic void setObject(LeoObject key, LeoObject value)
LeoObject
public LeoObject getObject(LeoObject key)
LeoObject
LeoObject
supports associations, this
will attempt to find the object with the associated key. If the key is not found, this will return LeoObject.NULL
.getObject
in class LeoObject
LeoObject.NULL
LeoObject.xgetObject(LeoObject)
public LeoObject xgetObject(LeoObject key) throws LeolaRuntimeException
LeoObject
LeoObject.getObject(LeoObject)
in every way, with the exception that
this will throw a LeolaRuntimeException
is the attribute is not found.xgetObject
in class LeoObject
LeolaRuntimeException
- if the key is not boundpublic boolean hasObject(LeoObject key)
LeoObject
public void putObject(String reference, LeoObject value)
setObject(LeoObject, LeoObject)
in that the latter
from will scan the parent scopes to determine if it should override a data member,
as this function will not, it will always place it in this Scope
reference
- value
- public void putObject(LeoObject reference, LeoObject value)
setObject(LeoObject, LeoObject)
in that the latter
from will scan the parent scopes to determine if it should override a data member,
as this function will not, it will always place it in this Scope
reference
- value
- public boolean hasProperty(LeoObject member)
Scope
or parent scopespublic LeoObject xgetProperty(LeoObject member) throws LeolaRuntimeException
member
- - the name of the propertyLeolaRuntimeException
LeolaRuntimeException
public LeoObject getProperty(LeoObject member)
member
- - the name of the propertyLeoNull
public LeoArray getPropertyNames()
public LeoArray getProperties()
public void addProperty(LeoObject member, LeoObject property)
LeoScopedObject
member
- property
- public void removeProperty(LeoObject member)
LeoScopedObject
member
- Copyright © 2010–2015. All rights reserved.