public final class Reflective extends Object
| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
KEYWORDS |
static String |
MAIN |
static Object |
NO_MATCH |
| Constructor and Description |
|---|
Reflective() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
coerce(CommandSession session,
Class<?> type,
Object arg,
int[] convert)
converts given argument to specified type and increments convert[0] if any conversion was needed.
|
static Object |
invoke(CommandSession session,
Object target,
String name,
List<Object> args)
invokes the named method on the given target using the supplied args,
which are converted if necessary.
|
public static final Object NO_MATCH
public static final String MAIN
public static Object invoke(CommandSession session, Object target, String name, List<Object> args) throws Exception
session - the sessiontarget - the targetname - the nameargs - the argsException - on exceptionpublic static Object coerce(CommandSession session, Class<?> type, Object arg, int[] convert)
session - the sessiontype - the typearg - the argconvert - convert[0] is incremented according to the conversion needed,
to allow the "best" conversion to be determined.Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.