Qore jni Module 2.3.1
Loading...
Searching...
No Matches
org.qore.jni.JavaClassBuilder Class Reference

Static Public Member Methods

static DynamicType.Builder<?> getFunctionConstantClassBuilder (String bin_name) throws NoSuchMethodException
 Returns a builder object for a dynamic class mapping Qore functions to static Java methods.
 
static DynamicType.Builder<?> addFunction (DynamicType.Builder<?> bb, String functionName, long pgm, long fptr, long vptr, TypeDefinition returnType, List< TypeDefinition > paramTypes, boolean varargs)
 Add a function to a function class.
 
static DynamicType.Builder<?> addStaticField (DynamicType.Builder<?> bb, String fieldName, int modifiers, TypeDescription fieldType, long cPtr, ArrayList< StaticEntry > staticList)
 Add a field to a class.
 
static DynamicType.Builder<?> createStaticInitializer (DynamicType.Builder<?> bb, String className, long pgm, ArrayList< StaticEntry > staticList)
 Creates the static initializer for a class.
 
static DynamicType.Builder<?> getClassBuilder (String className, Class<?> parentClass, ArrayList< Type > interfaces, boolean is_abstract, long cptr) throws NoSuchMethodException
 Returns a builder object for a dynamic class.
 
static DynamicType.Builder<?> addConstructor (DynamicType.Builder<?> bb, Class<?> parentClass, long mptr, long vptr, int visibility, List< TypeDefinition > paramTypes, boolean varargs)
 add a constructor
 
static DynamicType.Builder<?> addNormalMethod (DynamicType.Builder<?> bb, String methodName, long mptr, long vptr, int visibility, TypeDefinition returnType, List< TypeDefinition > paramTypes, boolean isAbstract, boolean varargs)
 add normal method
 
static DynamicType.Builder<?> addStaticMethod (DynamicType.Builder<?> bb, String methodName, long pgm, long mptr, long vptr, int visibility, TypeDefinition returnType, List< TypeDefinition > paramTypes, boolean varargs)
 add static method
 
static Object doStaticCall (String methodName, long qclsptr, long pgm, long mptr, long vptr, @Argument(0) Object... args) throws Throwable
 
static Object doNormalCall (String methodName, long qobjptr, long mptr, long vptr, @Argument(0) Object... args) throws Throwable
 
static Object doFunctionCall (long pgm, long fptr, long vptr, @Argument(0) Object... args) throws Throwable
 
static Object getConstantValue (long pgm, long cPtr) throws Throwable
 
static TypeDescription getTypeDescription (Class<?> cls)
 
static TypeDescription getTypeDescription (String future_name)
 
static boolean findBaseClassMethodConflict (Class<?> parentClass, String name, List< TypeDescription > params, boolean check_static)
 

Detailed Description

Helper class for building dynamic Java classes

Member Function Documentation

◆ doFunctionCall()

static Object org.qore.jni.JavaClassBuilder.doFunctionCall ( long  pgm,
long  fptr,
long  vptr,
@Argument(0) Object...  args 
) throws Throwable
inlinestatic

makes a function call

Parameters
fptrthe pointer to the Qore function object
vptrthe pointer to the method variant object
argsthe arguments to the call, if any, can be null
Returns
the result of the call
Exceptions
Throwableany exception thrown in Qore

◆ doNormalCall()

static Object org.qore.jni.JavaClassBuilder.doNormalCall ( String  methodName,
long  qobjptr,
long  mptr,
long  vptr,
@Argument(0) Object...  args 
) throws Throwable
inlinestatic

makes a normal method call

Parameters
methodNamethe name of the method
qobjptrthe pointer to the Qore object
mptrthe pointer to the Qore method object
vptrthe pointer to the method variant object
argsthe arguments to the call, if any, can be null
Returns
the result of the call
Exceptions
Throwableany exception thrown in Qore

◆ doStaticCall()

static Object org.qore.jni.JavaClassBuilder.doStaticCall ( String  methodName,
long  qclsptr,
long  pgm,
long  mptr,
long  vptr,
@Argument(0) Object...  args 
) throws Throwable
inlinestatic

makes a static method call

Parameters
methodNamethe name of the method
qclsptrthe class pointer
mptrthe method pointer
vptrthe variant pointer
argsthe arguments to the call, if any, can be null
Returns
the result of the call
Exceptions
Throwableany exception thrown in Qore

◆ findBaseClassMethodConflict()

static boolean org.qore.jni.JavaClassBuilder.findBaseClassMethodConflict ( Class<?>  parentClass,
String  name,
List< TypeDescription >  params,
boolean  check_static 
)
inlinestatic

Check a class for methods matching a name an TypeDescription list

◆ getConstantValue()

static Object org.qore.jni.JavaClassBuilder.getConstantValue ( long  pgm,
long  cPtr 
) throws Throwable
inlinestatic

retrieves the value of a constant from the given Qore program

Parameters
pgmthe pointer to the Qore program object
cPtrthe pointer the constant entry
Returns
the value of the given constant

◆ getTypeDescription() [1/2]

static TypeDescription org.qore.jni.JavaClassBuilder.getTypeDescription ( Class<?>  cls)
inlinestatic

Returns a TypeDescription object for the given class

Parameters
clsthe class to return a TypeDescription for

◆ getTypeDescription() [2/2]

static TypeDescription org.qore.jni.JavaClassBuilder.getTypeDescription ( String  future_name)
inlinestatic

Returns a TypeDescription for a future type based on the binary name

Parameters
future_nameThe binary name of the type to be created

The documentation for this class was generated from the following file: