GlueGen: com.jogamp.common.util.ReflectionUtil Class Reference

GlueGen v2.6.0-rc-20250822 GlueGen, Native Binding Generator for Java™ (public API).

Classes | Static Public Member Functions | Static Public Attributes | List of all members
com.jogamp.common.util.ReflectionUtil Class Reference
Collaboration diagram for com.jogamp.common.util.ReflectionUtil:

## Classes

class | AWTNames
class | MethodAccessor
| Convenient Method access class. More...

## Static Public Member Functions

static void | resetForNameCount ()
static StringBuilder | getForNameStats (StringBuilder sb)
static final boolean | isClassAvailable (final String clazzName, final ClassLoader cl)
| Returns true only if the class could be loaded. More...
static final Class<?> | getClass (final String clazzName, final boolean initializeClazz, final ClassLoader cl) throws JogampRuntimeException
| Loads and returns the class or null. More...
static final Constructor<?> | getConstructor (final String clazzName, final Class<?>[] cstrArgTypes, final boolean initializeClazz, final ClassLoader cl) throws JogampRuntimeException
static final Constructor<?> | getConstructor (final Class<?> clazz, Class<?> ... cstrArgTypes) throws JogampRuntimeException
| Returns a compatible constructor if available, otherwise throws an exception. More...
static final Constructor<?> | getConstructor (final String clazzName, final ClassLoader cl) throws JogampRuntimeException
static final Object | createInstance (final Constructor<?> cstr, final Object ... cstrArgs) throws JogampRuntimeException, RuntimeException
static final Object | createInstance (final Class<?> clazz, final Class<?>[] cstrArgTypes, final Object ... cstrArgs) throws JogampRuntimeException, RuntimeException
static final Object | createInstance (final Class<?> clazz, final Object ... cstrArgs) throws JogampRuntimeException, RuntimeException
static final Object | createInstance (final String clazzName, final Class<?>[] cstrArgTypes, final Object[] cstrArgs, final ClassLoader cl) throws JogampRuntimeException, RuntimeException
static final Object | createInstance (final String clazzName, final Object[] cstrArgs, final ClassLoader cl) throws JogampRuntimeException, RuntimeException
static final Object | createInstance (final String clazzName, final ClassLoader cl) throws JogampRuntimeException, RuntimeException
static final boolean | instanceOf (final Object obj, final String clazzName)
static final boolean | instanceOf (Class<?> clazz, final String clazzName)
static final boolean | implementationOf (final Object obj, final String faceName)
static final boolean | implementationOf (Class<?> clazz, final String faceName)
static boolean | isAWTComponent (final Object target)
static boolean | isAWTComponent (final Class<?> clazz)
static final Method | getMethod (final Class<?> clazz, final String methodName, final Class<?> ... argTypes) throws JogampRuntimeException, RuntimeException
static final Method | getMethod (final String clazzName, final String methodName, final Class<?>[] argTypes, final ClassLoader cl) throws JogampRuntimeException, RuntimeException
static final Object | callMethod (final Object instance, final Method method, final Object ... args) throws JogampRuntimeException, RuntimeException
static final Object | callStaticMethod (final String clazzName, final String methodName, final Class<?>[] argTypes, final Object[] args, final ClassLoader cl) throws JogampRuntimeException, RuntimeException

## Static Public Attributes

static final boolean | DEBUG
static final boolean | DEBUG_STATS_FORNAME

## Detailed Description

Definition at line 56 of file ReflectionUtil.java.

## Member Function Documentation

## ◆ callMethod()

static final Object com.jogamp.common.util.ReflectionUtil.callMethod | ( | final Object | instance,
|  | final Method | method,
|  | final Object ... | args
| ) |  | throws JogampRuntimeException, RuntimeException

static

Parameters

  instance | may be null in case of a static method
  method | the method to be called
  args | the method arguments

Returns
  the methods result, maybe null if void

Exceptions

  JogampRuntimeException | if call fails
  RuntimeException | if call fails

Definition at line 414 of file ReflectionUtil.java.

Here is the caller graph for this function:

## ◆ callStaticMethod()

static final Object com.jogamp.common.util.ReflectionUtil.callStaticMethod | ( | final String | clazzName,
|  | final String | methodName,
|  | final Class<?>[] | argTypes,
|  | final Object[] | args,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException, RuntimeException

static

Exceptions

  JogampRuntimeException | if the instance can not be created.

Definition at line 437 of file ReflectionUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ createInstance() [1/6]

static final Object com.jogamp.common.util.ReflectionUtil.createInstance | ( | final Class<?> | clazz,
|  | final Class<?>[] | cstrArgTypes,
|  | final Object ... | cstrArgs
| ) |  | throws JogampRuntimeException, RuntimeException

static

Exceptions

  JogampRuntimeException | if the instance can not be created.

Definition at line 286 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ createInstance() [2/6]

static final Object com.jogamp.common.util.ReflectionUtil.createInstance | ( | final Class<?> | clazz,
|  | final Object ... | cstrArgs
| ) |  | throws JogampRuntimeException, RuntimeException

static

Definition at line 292 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ createInstance() [3/6]

static final Object com.jogamp.common.util.ReflectionUtil.createInstance | ( | final Constructor<?> | cstr,
|  | final Object ... | cstrArgs
| ) |  | throws JogampRuntimeException, RuntimeException

static

Exceptions

  JogampRuntimeException | if the instance can not be created.

Definition at line 263 of file ReflectionUtil.java.

Here is the caller graph for this function:

## ◆ createInstance() [4/6]

static final Object com.jogamp.common.util.ReflectionUtil.createInstance | ( | final String | clazzName,
|  | final Class<?>[] | cstrArgTypes,
|  | final Object[] | cstrArgs,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException, RuntimeException

static

Definition at line 305 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ createInstance() [5/6]

static final Object com.jogamp.common.util.ReflectionUtil.createInstance | ( | final String | clazzName,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException, RuntimeException

static

Definition at line 328 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ createInstance() [6/6]

static final Object com.jogamp.common.util.ReflectionUtil.createInstance | ( | final String | clazzName,
|  | final Object[] | cstrArgs,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException, RuntimeException

static

Definition at line 315 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ getClass()

static final Class<?> com.jogamp.common.util.ReflectionUtil.getClass | ( | final String | clazzName,
|  | final boolean | initializeClazz,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException

static

Loads and returns the class or null.

See also
  Class::forName(java.lang.String, boolean, java.lang.ClassLoader)

Definition at line 170 of file ReflectionUtil.java.

## ◆ getConstructor() [1/3]

static final Constructor<?> com.jogamp.common.util.ReflectionUtil.getConstructor | ( | final Class<?> | clazz,
|  | Class<?> ... | cstrArgTypes
| ) |  | throws JogampRuntimeException

static

Returns a compatible constructor if available, otherwise throws an exception.

It first attempts to get the specific Constructor using the given `cstrArgTypes`. If this fails w/ `NoSuchMethodException`, a compatible Constructor is being looked-up w/ with parameter types assignable from the given `cstrArgs`.

Exceptions

  JogampRuntimeException | if the constructor can not be delivered.

Definition at line 220 of file ReflectionUtil.java.

## ◆ getConstructor() [2/3]

static final Constructor<?> com.jogamp.common.util.ReflectionUtil.getConstructor | ( | final String | clazzName,
|  | final Class<?>[] | cstrArgTypes,
|  | final boolean | initializeClazz,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException

static

Parameters

  initializeClazz | TODO

Exceptions

  JogampRuntimeException | if the constructor can not be delivered.

Definition at line 183 of file ReflectionUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ getConstructor() [3/3]

static final Constructor<?> com.jogamp.common.util.ReflectionUtil.getConstructor | ( | final String | clazzName,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException

static

Definition at line 255 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ getForNameStats()

static StringBuilder com.jogamp.common.util.ReflectionUtil.getForNameStats | ( | StringBuilder | sb | ) |

static

Definition at line 109 of file ReflectionUtil.java.

## ◆ getMethod() [1/2]

static final Method com.jogamp.common.util.ReflectionUtil.getMethod | ( | final Class<?> | clazz,
|  | final String | methodName,
|  | final Class<?> ... | argTypes
| ) |  | throws JogampRuntimeException, RuntimeException

static

Exceptions

  JogampRuntimeException | if the Method can not be found.

Definition at line 375 of file ReflectionUtil.java.

Here is the caller graph for this function:

## ◆ getMethod() [2/2]

static final Method com.jogamp.common.util.ReflectionUtil.getMethod | ( | final String | clazzName,
|  | final String | methodName,
|  | final Class<?>[] | argTypes,
|  | final ClassLoader | cl
| ) |  | throws JogampRuntimeException, RuntimeException

static

Exceptions

  JogampRuntimeException | if the Method can not be found.

Definition at line 396 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ implementationOf() [1/2]

static final boolean com.jogamp.common.util.ReflectionUtil.implementationOf | ( | Class<?> | clazz,
|  | final String | faceName
| ) |  |

static

Definition at line 350 of file ReflectionUtil.java.

## ◆ implementationOf() [2/2]

static final boolean com.jogamp.common.util.ReflectionUtil.implementationOf | ( | final Object | obj,
|  | final String | faceName
| ) |  |

static

Definition at line 347 of file ReflectionUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ instanceOf() [1/2]

static final boolean com.jogamp.common.util.ReflectionUtil.instanceOf | ( | Class<?> | clazz,
|  | final String | clazzName
| ) |  |

static

Definition at line 337 of file ReflectionUtil.java.

## ◆ instanceOf() [2/2]

static final boolean com.jogamp.common.util.ReflectionUtil.instanceOf | ( | final Object | obj,
|  | final String | clazzName
| ) |  |

static

Definition at line 334 of file ReflectionUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ isAWTComponent() [1/2]

static boolean com.jogamp.common.util.ReflectionUtil.isAWTComponent | ( | final Class<?> | clazz | ) |

static

Definition at line 368 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ isAWTComponent() [2/2]

static boolean com.jogamp.common.util.ReflectionUtil.isAWTComponent | ( | final Object | target | ) |

static

Definition at line 364 of file ReflectionUtil.java.

Here is the call graph for this function:

## ◆ isClassAvailable()

static final boolean com.jogamp.common.util.ReflectionUtil.isClassAvailable | ( | final String | clazzName,
|  | final ClassLoader | cl
| ) |  |

static

Returns true only if the class could be loaded.

Definition at line 158 of file ReflectionUtil.java.

Here is the caller graph for this function:

## ◆ resetForNameCount()

static void com.jogamp.common.util.ReflectionUtil.resetForNameCount | ( |  | ) |

static

Definition at line 100 of file ReflectionUtil.java.

## Member Data Documentation

## ◆ DEBUG

final boolean com.jogamp.common.util.ReflectionUtil.DEBUG

static

Definition at line 58 of file ReflectionUtil.java.

## ◆ DEBUG_STATS_FORNAME

final boolean com.jogamp.common.util.ReflectionUtil.DEBUG_STATS_FORNAME

static

Definition at line 59 of file ReflectionUtil.java.

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

- src/java/com/jogamp/common/util/ReflectionUtil.java