public abstract class LeoObject extends Object implements Comparable<LeoObject>
Leola
types. The basic design principal for the LeoObject
is to treat all
types the same, that is avoid the need to cast as much as possible and error if the underlying type does not
support an operation.
This does have the negative consequence of having the LeoObject
blow up in size and responsibility. However, I
feel the trade-off is warranted.
There are a number of operators that can be overridden (both in Java and Leola code). The operators include:
Leola Operator | Java/Leola method name | Description |
---|---|---|
=== | $req | Reference equals operator, the default functionality is to check the equality of the references (identical to Java '==' operator) |
== | $eq | Object equals operator, the default functionality is to check the equality of the objects (identical to Java equals method) |
!= | $neq | Object not equals operator, the default functionality is to check the negated equality of the objects (identical to Java !equals method) |
< | $lt | Object less than operator, the default functionality is to check if the left hand object is less than the right hand object (identical to Java < operator) |
<= | $lte | Object less than or equals operator, the default functionality is to check if the left hand object is less than or equal to the right hand object (identical to Java equals method and/or the < operator) |
> | $gt | Object greater than operator, the default functionality is to check if the left hand object is greater than the right hand object (identical to Java > operator) |
>= | $gte | Object greater than or equals operator, the default functionality is to check if the left hand object is greater than or equal to the right hand object (identical to Java equals method and/or the > operator) |
+ | $add | Object addition operator, the default functionality is to add the right hand object to the left hand object (identical to Java + operator) |
- | $sub | Object subtraction operator, the default functionality is to subtract the right hand object from the left hand object (identical to Java - operator) |
* | $mul | Object multiplication operator, the default functionality is to multiply the right hand object by the left hand object (identical to Java * operator) |
/ | $div | Object division operator, the default functionality is to divide the left hand object by the right hand object (identical to Java / operator) |
% | $mod | Object remainder (or modules) operator, the default functionality is to take the remainder of dividing the left hand object by the right hand object (identical to Java % operator) |
! | $neg | Object negate operator, the default functionality is to take the negative of the object (identical to Java ! operator) |
~ | $bnot | Object binary NOT operator, the default functionality is to negate/flip the object (identical to Java ~ operator) |
& | $band | Object binary AND operator, the default functionality is to binary AND together the right hand object and the left hand object (identical to Java & operator) |
| | $bor | Object binary OR operator, the default functionality is to binary OR together the right hand object and the left hand object (identical to Java | operator) |
<< | $bsl | Object binary shift left operator, the default functionality is to binary shift left the left hand object by the right hand object (identical to Java << operator) |
>> | $bsr | Object binary shift right operator, the default functionality is to binary shift right the left hand object by the right hand object (identical to Java >> operator) |
^ | $xor | Object binary EXCLUSIVE OR operator, the default functionality is to binary exclusive or of the left hand object by the right hand object (identical to Java ^ operator) |
[] | $sindex | Object set at index operator, the default functionality is to set the right hand object at the supplied index of the left hand object (identical to Java left[index] = right operator) |
[] | $index | Object get object at index operator, the default functionality is to retrieve the object at the supplied index (identical to Java left[index] operator) |
toString() | toString | Object toString operator, should convert the object to a String object (identical to Java toString() method) |
Some example Leola scripts that override the above operators:
class Vector(x, y) { var $add = def(other) { return new Vector(x+other.x, y+other.y) } var $sub = def(other) { return new Vector(x-other.x, y-other.y) } var $mul = def(other) { return case when other is Vector -> new Vector(x*other.x, y*other.y) else new Vector(x*other, y*other) } var toString = def() { return "(" + x + "," + y + ")" } } var v = new Vector(10, 5) var z = new Vector(4, 10) var delta = v-z println(delta) // (6,-5) println(delta * 2) // 12, -10
Modifier and Type | Class and Description |
---|---|
static class |
LeoObject.LeoType |
Modifier and Type | Field and Description |
---|---|
static LeoString |
ADD |
static LeoString |
BAND |
static LeoString |
BNOT |
static LeoString |
BOR |
static LeoString |
BSL |
static LeoString |
BSR |
static LeoString |
DIV |
static LeoString |
EQ |
static LeoObject |
FALSE |
static LeoString |
GT |
static LeoString |
GTE |
static LeoString |
INDEX |
static LeoString |
LT |
static LeoString |
LTE |
static LeoString |
MOD |
static LeoString |
MUL |
static LeoString |
NEG |
static LeoString |
NEQ |
static LeoObject |
NULL
A convenience means for retrieving the
LeoNull object |
static LeoString |
REQ |
static LeoString |
SINDEX |
static LeoString |
SUB |
static LeoString |
toString |
static LeoObject |
TRUE |
static LeoString |
XOR |
Modifier | Constructor and Description |
---|---|
protected |
LeoObject(LeoObject.LeoType type) |
Modifier and Type | Method and Description |
---|---|
LeoObject |
$add(double other) |
LeoObject |
$add(int other) |
LeoObject |
$add(LeoObject other) |
LeoObject |
$add(long other) |
LeoObject |
$band(double other) |
LeoObject |
$band(int other) |
LeoObject |
$band(LeoObject other) |
LeoObject |
$band(long other) |
LeoObject |
$bnot() |
LeoObject |
$bor(double other) |
LeoObject |
$bor(int other) |
LeoObject |
$bor(LeoObject other) |
LeoObject |
$bor(long other) |
LeoObject |
$bsl(double other) |
LeoObject |
$bsl(int other) |
LeoObject |
$bsl(LeoObject other) |
LeoObject |
$bsl(long other) |
LeoObject |
$bsr(double other) |
LeoObject |
$bsr(int other) |
LeoObject |
$bsr(LeoObject other) |
LeoObject |
$bsr(long other) |
LeoObject |
$div(double other) |
LeoObject |
$div(int other) |
LeoObject |
$div(LeoObject other) |
LeoObject |
$div(long other) |
boolean |
$eq(double other) |
boolean |
$eq(int other) |
abstract boolean |
$eq(LeoObject other)
Determines if it equals another object.
|
static boolean |
$eq(LeoObject left,
LeoObject right)
Determines if the two objects are equal.
|
boolean |
$eq(long other) |
boolean |
$gt(double other) |
boolean |
$gt(int other) |
abstract boolean |
$gt(LeoObject other)
If it's greater than to another object
|
boolean |
$gt(long other) |
boolean |
$gte(double other) |
boolean |
$gte(int other) |
boolean |
$gte(LeoObject other)
If it's greater than or equal to another object.
|
boolean |
$gte(long other) |
LeoObject |
$index(double other) |
LeoObject |
$index(int other) |
LeoObject |
$index(LeoObject other) |
LeoObject |
$index(long other) |
boolean |
$lt(double other) |
boolean |
$lt(int other) |
abstract boolean |
$lt(LeoObject other)
If it's less than to another object
|
boolean |
$lt(long other) |
boolean |
$lte(double other) |
boolean |
$lte(int other) |
boolean |
$lte(LeoObject other)
If it's less than or equal to another object.
|
boolean |
$lte(long other) |
LeoObject |
$mod(double other) |
LeoObject |
$mod(int other) |
LeoObject |
$mod(LeoObject other) |
LeoObject |
$mod(long other) |
LeoObject |
$mul(double other) |
LeoObject |
$mul(int other) |
LeoObject |
$mul(LeoObject other) |
LeoObject |
$mul(long other) |
LeoObject |
$neg() |
boolean |
$neq(double other) |
boolean |
$neq(int other) |
boolean |
$neq(LeoObject other)
If it's not equal another object.
|
boolean |
$neq(long other) |
boolean |
$req(LeoObject other)
Tests if the references are the same.
|
void |
$sindex(LeoObject key,
LeoObject other) |
LeoObject |
$sub(double other) |
LeoObject |
$sub(int other) |
LeoObject |
$sub(LeoObject other) |
LeoObject |
$sub(long other) |
LeoObject |
$xor(double other) |
LeoObject |
$xor(int other) |
LeoObject |
$xor(LeoObject other) |
LeoObject |
$xor(long other) |
<T extends LeoObject> |
as()
Up Casts this
LeoObject |
static <T extends LeoObject> |
as(LeoObject obj)
Up Casts the supplied
LeoObject |
byte |
asByte() |
char |
asChar() |
double |
asDouble() |
float |
asFloat() |
int |
asInt() |
long |
asLong() |
short |
asShort() |
LeoObject |
call()
Invokes the function
|
LeoObject |
call(LeoObject arg1)
Invokes the function
|
LeoObject |
call(LeoObject[] args)
Invokes the function
|
LeoObject |
call(LeoObject arg1,
LeoObject arg2)
Invokes the function
|
LeoObject |
call(LeoObject arg1,
LeoObject arg2,
LeoObject arg3)
Invokes the function
|
LeoObject |
call(LeoObject arg1,
LeoObject arg2,
LeoObject arg3,
LeoObject arg4)
Invokes the function
|
LeoObject |
call(LeoObject arg1,
LeoObject arg2,
LeoObject arg3,
LeoObject arg4,
LeoObject arg5)
Invokes the function
|
abstract LeoObject |
clone() |
int |
compareTo(LeoObject other) |
boolean |
equals(Object obj) |
LeoObject[] |
getLocals() |
protected static LeoObject |
getNativeMember(Class<?> ownerClass,
Object owner,
Map<LeoObject,LeoObject> nativeApi,
LeoObject key)
Retrieve the native methods or fields from the owner public method listings.
|
protected static LeoObject |
getNativeMethod(Class<?> ownerClass,
Object owner,
Map<LeoObject,LeoObject> nativeApi,
LeoObject key)
Retrieve the native methods from the owner public method listings.
|
protected static LeoObject |
getNativeMethod(Object owner,
Map<LeoObject,LeoObject> nativeApi,
LeoObject key)
Retrieve the native methods from the owner public method listings.
|
int |
getNumberOfArgs() |
LeoObject |
getObject(LeoObject key)
Retrieves a property from this object.
|
LeoObject |
getObject(String key)
Retrieves a property from this object.
|
Outer[] |
getOuters() |
Scope |
getScope() |
LeoObject.LeoType |
getType() |
abstract Object |
getValue() |
Object |
getValue(Class<?> narrowType)
Attempts to narrow the
LeoObject to a more specific Java Type |
protected static boolean |
hasNativeMethod(Class<?> aClass,
LeoObject methodName)
Determines if the supplied class has a method by the supplied method name.
|
protected static boolean |
hasNativeMethod(Object owner,
LeoObject methodName)
Determines if the supplied owner has a method by the supplied method name.
|
boolean |
hasObject(LeoObject key)
Determines if the supplied key has an associated value
|
boolean |
hasObject(String key)
Determines if the supplied key has an associated value
|
boolean |
hasVarargs() |
boolean |
isArray() |
boolean |
isAssignable(Class<?> javaType)
Determines if the supplied Java type can be assigned to this
LeoObject . |
boolean |
isBoolean() |
boolean |
isClass() |
boolean |
isError() |
boolean |
isFunction() |
boolean |
isGenerator() |
boolean |
isMap() |
boolean |
isNamespace() |
boolean |
isNativeClass() |
boolean |
isNativeFunction() |
boolean |
isNull() |
boolean |
isNumber() |
boolean |
isOfType(Class<?>... leoTypes)
Determines if its one of these types
|
boolean |
isOfType(LeoObject.LeoType... leoTypes)
Determines if its one of these types
|
boolean |
isOfType(LeoObject.LeoType leoType)
Determines if its one of these types
|
boolean |
isOfType(String rawType)
Determines if this type is of the supplied type.
|
boolean |
isOuter() |
boolean |
isScopedObject() |
boolean |
isString() |
boolean |
isTrue()
Determines if the supplied object is of type TRUE.
|
static boolean |
isTrue(LeoObject obj)
Determines if the supplied object is of type TRUE.
|
static LeoObject |
read(LeoObject env,
DataInput in)
|
protected static void |
removeInterfaceMethods(List<Method> methods)
HACK - removes weird interface methods from the API listing.
|
static void |
rethrow(Throwable t)
Rethrows the supplied
Throwable as a LeolaRuntimeException |
void |
setObject(LeoObject key,
LeoObject value)
Sets a property on this object.
|
void |
setObject(String key,
LeoObject value)
Sets a property on this object.
|
static void |
throwAttributeAccessError(Class<?> ownerClass,
LeoObject name)
Throws a
LeolaRuntimeException denoting an AttributeAccessError, stating that a requested attribute
could not be accessed in the owned scope and/or class. |
static void |
throwAttributeError(Class<?> ownerClass,
LeoObject name)
Throws a
LeolaRuntimeException denoting an AttributeError, stating that a requested attribute
does not exist in the owned scope and/or class. |
void |
throwAttributeError(LeoObject name)
Throws a
LeolaRuntimeException denoting an AttributeError, stating that a requested attribute
does not exist in the owned scope. |
static void |
throwClassNotFoundError(String message)
Throws a ClassNotFoundError
|
static void |
throwDivideByZeroError()
Throws a
LeolaRuntimeException denoting a DivideByZeroError. |
LeoObject |
throwIfError()
Throws a
LeolaRuntimeException if this is a LeoError instance |
static void |
throwMethodError(String message)
Throws a MethodError
|
static void |
throwNativeMethodError(String message)
Throws a NativeMethodError
|
void |
throwNotImplementedError(String functionName)
Throws a
LeolaRuntimeException denoting a NotImplemetnedError. |
static Object |
toJavaObject(Class<?> jtype,
LeoObject v)
Attempts to convert the supplied
LeoObject into the equivalent Java Object using
the supplied Class as a hint. |
LeoString |
toLeoString() |
String |
toString() |
static LeoObject |
valueOf(Object v)
Converts the supplied Java object into the appropriate
LeoObject type. |
abstract void |
write(DataOutput out)
Writes this object out
|
LeoObject |
xcall()
This is the equivalent of:
|
LeoObject |
xcall(LeoObject arg1)
This is the equivalent of:
|
LeoObject |
xcall(LeoObject[] args)
This is the equivalent of:
|
LeoObject |
xcall(LeoObject arg1,
LeoObject arg2)
This is the equivalent of:
|
LeoObject |
xcall(LeoObject arg1,
LeoObject arg2,
LeoObject arg3)
This is the equivalent of:
|
LeoObject |
xcall(LeoObject arg1,
LeoObject arg2,
LeoObject arg3,
LeoObject arg4)
This is the equivalent of:
|
LeoObject |
xcall(LeoObject arg1,
LeoObject arg2,
LeoObject arg3,
LeoObject arg4,
LeoObject arg5)
This is the equivalent of:
|
LeoObject |
xgetObject(LeoObject key)
Similar to
getObject(LeoObject) in every way, with the exception that
this will throw a LeolaRuntimeException is the attribute is not found. |
LeoObject |
xgetObject(String key)
Similar to
getObject(String) in every way, with the exception that
this will throw a LeolaRuntimeException is the attribute is not found. |
public static final LeoString REQ
public static final LeoString EQ
public static final LeoString NEQ
public static final LeoString LT
public static final LeoString LTE
public static final LeoString GT
public static final LeoString GTE
public static final LeoString ADD
public static final LeoString SUB
public static final LeoString MUL
public static final LeoString DIV
public static final LeoString MOD
public static final LeoString NEG
public static final LeoString BNOT
public static final LeoString BAND
public static final LeoString BOR
public static final LeoString BSL
public static final LeoString BSR
public static final LeoString XOR
public static final LeoString INDEX
public static final LeoString SINDEX
public static final LeoString toString
public static final LeoObject TRUE
public static final LeoObject FALSE
protected LeoObject(LeoObject.LeoType type)
type
- public static final LeoObject valueOf(Object v)
LeoObject
type.v
- the Java objectLeoObject
type.public static final Object toJavaObject(Class<?> jtype, LeoObject v)
LeoObject
into the equivalent Java Object using
the supplied Class as a hint.public LeoString toLeoString()
public LeoObject.LeoType getType()
public Scope getScope()
public Outer[] getOuters()
public LeoObject[] getLocals()
public boolean isNull()
public boolean isNumber()
public boolean isString()
public boolean isMap()
public boolean isArray()
public boolean isBoolean()
public boolean isClass()
public boolean isNativeClass()
public boolean isGenerator()
public boolean isFunction()
public boolean isNativeFunction()
public boolean isOuter()
public boolean isError()
public boolean isNamespace()
public boolean isScopedObject()
public boolean isOfType(LeoObject.LeoType leoType)
leoTypes
- public boolean isOfType(LeoObject.LeoType... leoTypes)
leoTypes
- public boolean isOfType(Class<?>... leoTypes)
leoTypes
- public boolean isOfType(String rawType)
rawType
- public static <T extends LeoObject> T as(LeoObject obj)
LeoObject
T
- obj
- public int asInt()
public long asLong()
public double asDouble()
public float asFloat()
public byte asByte()
public short asShort()
public char asChar()
public static boolean $eq(LeoObject left, LeoObject right)
left
- right
- public static boolean isTrue(LeoObject obj)
obj
- public boolean isTrue()
obj
- public boolean $req(LeoObject other)
other
- public abstract boolean $eq(LeoObject other)
other
- public boolean $eq(int other)
public boolean $eq(double other)
public boolean $eq(long other)
public boolean $neq(LeoObject other)
other
- public boolean $neq(int other)
public boolean $neq(double other)
public boolean $neq(long other)
public abstract boolean $lt(LeoObject other)
other
- public boolean $lt(int other)
public boolean $lt(double other)
public boolean $lt(long other)
public boolean $lte(LeoObject other)
other
- public boolean $lte(int other)
public boolean $lte(double other)
public boolean $lte(long other)
public abstract boolean $gt(LeoObject other)
other
- public boolean $gt(int other)
public boolean $gt(double other)
public boolean $gt(long other)
public boolean $gte(LeoObject other)
other
- public boolean $gte(int other)
public boolean $gte(double other)
public boolean $gte(long other)
public LeoObject $add(int other)
public LeoObject $sub(int other)
public LeoObject $mul(int other)
public LeoObject $div(int other)
public LeoObject $mod(int other)
public LeoObject $add(double other)
public LeoObject $sub(double other)
public LeoObject $mul(double other)
public LeoObject $div(double other)
public LeoObject $mod(double other)
public LeoObject $add(long other)
public LeoObject $sub(long other)
public LeoObject $mul(long other)
public LeoObject $div(long other)
public LeoObject $mod(long other)
public LeoObject $neg()
public LeoObject $bnot()
public LeoObject $index(int other)
public LeoObject $bsl(int other)
public LeoObject $bsr(int other)
public LeoObject $xor(int other)
public LeoObject $bor(int other)
public LeoObject $band(int other)
public LeoObject $index(double other)
public LeoObject $bsl(double other)
public LeoObject $bsr(double other)
public LeoObject $xor(double other)
public LeoObject $bor(double other)
public LeoObject $band(double other)
public LeoObject $index(long other)
public LeoObject $bsl(long other)
public LeoObject $bsr(long other)
public LeoObject $xor(long other)
public LeoObject $bor(long other)
public LeoObject $band(long other)
public void setObject(LeoObject key, LeoObject value)
key
- value
- public void setObject(String key, LeoObject value)
key
- -- converts to a LeoStringvalue
- public LeoObject xgetObject(LeoObject key) throws LeolaRuntimeException
getObject(LeoObject)
in every way, with the exception that
this will throw a LeolaRuntimeException
is the attribute is not found.key
- LeolaRuntimeException
- if the key is not boundpublic LeoObject xgetObject(String key) throws LeolaRuntimeException
getObject(String)
in every way, with the exception that
this will throw a LeolaRuntimeException
is the attribute is not found.key
- LeolaRuntimeException
- if the key is not boundpublic LeoObject getObject(LeoObject key)
LeoObject
supports associations, this
will attempt to find the object with the associated key. If the key is not found, this will return NULL
.key
- NULL
xgetObject(LeoObject)
public LeoObject getObject(String key)
key
- - converts to a LeoStringpublic boolean hasObject(String key)
key
- public boolean hasObject(LeoObject key)
key
- public LeoObject xcall() throws LeolaRuntimeException
LeoObject result = x.call().throwIfError();
LeolaRuntimeException
- if the result of invoking the object returns a LeoError
public LeoObject xcall(LeoObject arg1) throws LeolaRuntimeException
LeoObject result = x.call(arg1).throwIfError();
arg1
- the first argumentLeolaRuntimeException
- if the result of invoking the object returns a LeoError
public LeoObject xcall(LeoObject arg1, LeoObject arg2) throws LeolaRuntimeException
LeoObject result = x.call(arg1,arg2).throwIfError();
arg1
- the first argumentarg2
- the second argumentLeolaRuntimeException
- if the result of invoking the object returns a LeoError
public LeoObject xcall(LeoObject arg1, LeoObject arg2, LeoObject arg3) throws LeolaRuntimeException
LeoObject result = x.call(arg1,arg2,arg3).throwIfError();
arg1
- the first argumentarg2
- the second argumentarg3
- the third argumentLeolaRuntimeException
- if the result of invoking the object returns a LeoError
public LeoObject xcall(LeoObject arg1, LeoObject arg2, LeoObject arg3, LeoObject arg4) throws LeolaRuntimeException
LeoObject result = x.call(arg1,arg2,arg3,arg4).throwIfError();
arg1
- the first argumentarg2
- the second argumentarg3
- the third argumentarg4
- the fourth argumentLeolaRuntimeException
- if the result of invoking the object returns a LeoError
public LeoObject xcall(LeoObject arg1, LeoObject arg2, LeoObject arg3, LeoObject arg4, LeoObject arg5) throws LeolaRuntimeException
LeoObject result = x.call(arg1,arg2,arg3,arg4,arg5).throwIfError();
arg1
- the first argumentarg2
- the second argumentarg3
- the third argumentarg4
- the fourth argumentarg5
- the fifth argumentLeolaRuntimeException
- if the result of invoking the object returns a LeoError
public LeoObject xcall(LeoObject[] args) throws LeolaRuntimeException
LeoObject result = x.call(args).throwIfError();
args
- the argument listLeolaRuntimeException
- if the result of invoking the object returns a LeoError
public LeoObject call()
public LeoObject call(LeoObject arg1)
arg1
- public LeoObject call(LeoObject arg1, LeoObject arg2)
arg1
- arg2
- public LeoObject call(LeoObject arg1, LeoObject arg2, LeoObject arg3)
arg1
- arg2
- arg3
- public LeoObject call(LeoObject arg1, LeoObject arg2, LeoObject arg3, LeoObject arg4)
arg1
- arg2
- arg3
- arg4
- public LeoObject call(LeoObject arg1, LeoObject arg2, LeoObject arg3, LeoObject arg4, LeoObject arg5)
arg1
- arg2
- arg3
- arg4
- arg5
- public LeoObject call(LeoObject[] args)
args
- public abstract Object getValue()
public Object getValue(Class<?> narrowType)
LeoObject
to a more specific Java TypenarrowType
- public boolean isAssignable(Class<?> javaType)
LeoObject
.javaType
- LeoObject
public abstract LeoObject clone()
public int compareTo(LeoObject other)
compareTo
in interface Comparable<LeoObject>
public int getNumberOfArgs()
public boolean hasVarargs()
public abstract void write(DataOutput out) throws IOException
out
- IOException
public static LeoObject read(LeoObject env, DataInput in) throws IOException
in
- LeoObject
IOException
public LeoObject throwIfError() throws LeolaRuntimeException
LeolaRuntimeException
if this is a LeoError
instanceLeolaRuntimeException
- the underlying LeoError
public static void throwClassNotFoundError(String message) throws LeolaRuntimeException
message
- the error messageLeolaRuntimeException
public static void throwMethodError(String message) throws LeolaRuntimeException
message
- the error messageLeolaRuntimeException
public static void throwNativeMethodError(String message) throws LeolaRuntimeException
message
- the error messageLeolaRuntimeException
public static void throwDivideByZeroError() throws LeolaRuntimeException
LeolaRuntimeException
denoting a DivideByZeroError.LeolaRuntimeException
public void throwNotImplementedError(String functionName) throws LeolaRuntimeException
LeolaRuntimeException
denoting a NotImplemetnedError.LeolaRuntimeException
public void throwAttributeError(LeoObject name) throws LeolaRuntimeException
LeolaRuntimeException
denoting an AttributeError, stating that a requested attribute
does not exist in the owned scope.name
- the name of the attributeLeolaRuntimeException
public static void throwAttributeError(Class<?> ownerClass, LeoObject name) throws LeolaRuntimeException
LeolaRuntimeException
denoting an AttributeError, stating that a requested attribute
does not exist in the owned scope and/or class.ownerClass
- the containing class in which the attribute was requested.name
- the name of the attributeLeolaRuntimeException
public static void throwAttributeAccessError(Class<?> ownerClass, LeoObject name) throws LeolaRuntimeException
LeolaRuntimeException
denoting an AttributeAccessError, stating that a requested attribute
could not be accessed in the owned scope and/or class.ownerClass
- the containing class in which the attribute was requested.name
- the name of the attributeLeolaRuntimeException
public static void rethrow(Throwable t) throws LeolaRuntimeException
Throwable
as a LeolaRuntimeException
t
- LeolaRuntimeException
protected static boolean hasNativeMethod(Object owner, LeoObject methodName)
owner
- methodName
- protected static boolean hasNativeMethod(Class<?> aClass, LeoObject methodName)
aClass
- methodName
- protected static LeoObject getNativeMember(Class<?> ownerClass, Object owner, Map<LeoObject,LeoObject> nativeApi, LeoObject key)
Map
is empty.ownerClass
- the class in which to inspectowner
- the instance in which owns the native methods; this may be null if looking for static methodsnativeApi
- the cache of native methodskey
- the method nameLeoObject
of the native method, or null if not foundprotected static LeoObject getNativeMethod(Class<?> ownerClass, Object owner, Map<LeoObject,LeoObject> nativeApi, LeoObject key)
Map
is empty.ownerClass
- the class in which to inspectowner
- the instance in which owns the native methods; this may be null if looking for static methodsnativeApi
- the cache of native methodskey
- the method nameLeoObject
of the native method, or null if not foundprotected static LeoObject getNativeMethod(Object owner, Map<LeoObject,LeoObject> nativeApi, LeoObject key)
Map
is empty.owner
- the instance in which owns the native methods; owner can not be nullnativeApi
- the cache of native methodskey
- the method nameLeoObject
of the native method, or null if not foundCopyright © 2010–2015. All rights reserved.