public class ReflectionLeolaLibrary extends Object implements LeolaLibrary
Constructor and Description |
---|
ReflectionLeolaLibrary() |
Modifier and Type | Method and Description |
---|---|
LeoObject |
_implements(String interfaceName,
LeoObject leoMethods)
Implements a Java Interface
|
LeoNativeClass |
asNativeClass(Object obj)
Converts the supplied object to a
LeoNativeClass |
LeoObject |
call(LeoObject func,
LeoObject... params)
Calls the function and applies the array as function arguments to this function.
|
LeoObject |
clone(LeoObject obj)
Clones the object
|
LeoArray |
getInstanceMethodsByName(Object instance,
String methodName)
Retrieves the instance methods of the supplied object
|
LeoClass.Metaclass |
getMetaclass(LeoObject aClass)
Retrieves the
LeoClass.Metaclass information from the supplied LeoClass |
LeoArray |
getStaticMethods(Object instance)
Retrieves the all instance methods of the supplied class
|
LeoArray |
getStaticMethods(String className)
Retrieves the all static methods of the supplied class
|
LeoArray |
getStaticMethodsByName(String className,
String methodName)
Retrieves the static methods of the supplied class
|
void |
init(Leola runtime,
LeoNamespace namespace)
Initializes the library.
|
LeoArray |
instrospect(Object obj)
Introspects the supplied object.
|
LeoArray |
instrospectNames(Object obj)
Retrieves all of the names of the supplied objects attributes.
|
LeoObject |
newInstance(LeoObject classname,
LeoObject... params)
Reflectively create a new instance of a class.
|
String |
type(LeoObject obj) |
public void init(Leola runtime, LeoNamespace namespace) throws LeolaRuntimeException
LeolaLibrary
init
in interface LeolaLibrary
LeolaRuntimeException
public LeoNativeClass asNativeClass(Object obj)
LeoNativeClass
obj
- LeoNativeClass
representationpublic LeoObject newInstance(LeoObject classname, LeoObject... params)
classname
- params
- public LeoArray instrospectNames(Object obj) throws Exception
obj
- Exception
public LeoArray instrospect(Object obj) throws Exception
obj
- the object to inspectException
public LeoArray getStaticMethods(String className) throws Exception
className
- LeoArray
or LeoNativeFunction
's that match the supplied methodNameException
public LeoArray getStaticMethods(Object instance) throws Exception
instance
- LeoArray
or LeoNativeFunction
's that match the supplied methodNameException
public LeoArray getStaticMethodsByName(String className, String methodName) throws Exception
className
- methodName
- LeoArray
or LeoNativeFunction
's that match the supplied methodNameException
public LeoArray getInstanceMethodsByName(Object instance, String methodName) throws Exception
instance
- methodName
- LeoArray
or LeoNativeFunction
's that match the supplied methodNameException
public LeoObject _implements(String interfaceName, LeoObject leoMethods) throws Exception
interfaceName
- leoMethods
- Exception
public final LeoObject clone(LeoObject obj)
obj
- public final LeoObject call(LeoObject func, LeoObject... params)
func
- params
- public LeoClass.Metaclass getMetaclass(LeoObject aClass)
LeoClass.Metaclass
information from the supplied LeoClass
aClass
- LeoClass.Metaclass
Copyright © 2010–2015. All rights reserved.