/** * Invoke a method on the given object with the given arguments. * * @param object The object the method should be invoked on. * @param methodName The name of the method to invoke. * @param arguments The arguments to the invoked method as null, a Tuple, an array or a single argument of any type. * * @return The result of the method invocation. */ public Object invokeMethod(Object object, String methodName, Object arguments) { if (arguments == null) { return invokeMethod(object, methodName, MetaClassHelper.EMPTY_ARRAY); } if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return invokeMethod(object, methodName, tuple.toArray()); } if (arguments instanceof Object[]) { return invokeMethod(object, methodName, (Object[]) arguments); } else { return invokeMethod(object, methodName, new Object[]{arguments}); } }
private static Object[] unwrapArgs(Object arguments) { if (arguments == null) { return MetaClassHelper.EMPTY_ARRAY; } else if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return tuple.toArray(); } else if (arguments instanceof Object[]) { return (Object[])arguments; } else { return new Object[]{arguments}; } }
@Override public Object invokeMethod(final Object object, final String name, final Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } else if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } else if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[]{args}); } }
@Override public Object invokeMethod(Object object, String name, Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[]{args}); } }
static Object[] unwrapArgs(Object arguments) { if (arguments == null) { return MetaClassHelper.EMPTY_ARRAY; } else if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return tuple.toArray(); } else if (arguments instanceof Object[]) { return (Object[])arguments; } else { return new Object[]{arguments}; } }
private static Object[] unwrapArgs(Object arguments) { if (arguments == null) { return MetaClassHelper.EMPTY_ARRAY; } else if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return tuple.toArray(); } else if (arguments instanceof Object[]) { return (Object[])arguments; } else { return new Object[]{arguments}; } }
private static Object[] unwrapArgs(Object arguments) { if (arguments == null) { return MetaClassHelper.EMPTY_ARRAY; } else if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return tuple.toArray(); } else if (arguments instanceof Object[]) { return (Object[])arguments; } else { return new Object[]{arguments}; } }
private Object[] unwrapMethodArguments(Object arguments) { if (arguments == null) { return MetaClassHelper.EMPTY_ARRAY; } if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return tuple.toArray(); } if (arguments instanceof Object[]) { return (Object[]) arguments; } else { return new Object[]{arguments}; } } }
@Override public Object invokeMethod(Object object, String name, Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } else if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } else if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[]{args}); } }
@Override public Object invokeMethod(final Object object, final String name, final Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } else if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } else if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[]{args}); } }
/** * Invokes a method on the given object, with the given name and single argument. * * @see #invokeMethod(Object, String, Object[]) * @param object The Object to invoke the method on * @param methodName The name of the method * @param arguments The argument to the method * @return The return value of the method which is null if the return type is void */ @Override public Object invokeMethod(final Object object, final String methodName, final Object arguments) { if (arguments == null) { return invokeMethod(object, methodName, MetaClassHelper.EMPTY_ARRAY); } else if (arguments instanceof Tuple) { return invokeMethod(object, methodName,((Tuple)arguments).toArray()); } else if (arguments instanceof Object[]) { return invokeMethod(object, methodName, (Object[])arguments); } else { return invokeMethod(object, methodName, new Object[] { arguments }); } } /**
public Object invokeMethod(Object object, String methodName, Object arguments) { if (arguments == null) { return invokeMethod(object, methodName, MetaClassHelper.EMPTY_ARRAY); } if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return invokeMethod(object, methodName, tuple.toArray()); } if (arguments instanceof Object[]) { return invokeMethod(object, methodName, (Object[]) arguments); } else { return invokeMethod(object, methodName, new Object[]{arguments}); } }
@Override public Object invokeMethod(Object object, String name, Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[]{args}); } }
public Object invokeMethod(Object object, String methodName, Object arguments) { if (arguments == null) { return invokeMethod(object, methodName, MetaClassHelper.EMPTY_ARRAY); } if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return invokeMethod(object, methodName, tuple.toArray()); } if (arguments instanceof Object[]) { return invokeMethod(object, methodName, (Object[]) arguments); } else { return invokeMethod(object, methodName, new Object[]{arguments}); } }
@Override public Object invokeMethod(Object object, String name, Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple)args).toArray()); } if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[] { args }); } }
public Object invokeMethod(Object object, String methodName, Object arguments) { if (arguments == null) { return invokeMethod(object, methodName, MetaClassHelper.EMPTY_ARRAY); } if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return invokeMethod(object, methodName, tuple.toArray()); } if (arguments instanceof Object[]) { return invokeMethod(object, methodName, (Object[]) arguments); } else { return invokeMethod(object, methodName, new Object[]{arguments}); } }
@Override public Object invokeMethod(Object object, String name, Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[]{args}); } }
public Object invokeMethod(Object object, String methodName, Object arguments) { if (arguments == null) { return invokeMethod(object, methodName, MetaClassHelper.EMPTY_ARRAY); } if (arguments instanceof Tuple) { Tuple tuple = (Tuple) arguments; return invokeMethod(object, methodName, tuple.toArray()); } if (arguments instanceof Object[]) { return invokeMethod(object, methodName, (Object[]) arguments); } else { return invokeMethod(object, methodName, new Object[]{arguments}); } }
@Override public Object invokeMethod(Object object, String name, Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } else { return invokeMethod(object, name, new Object[] { args }); } } @Override
@Override public Object invokeMethod(final Object object, final String name, final Object args) { if (args == null) { return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY); } if (args instanceof Tuple) { return invokeMethod(object, name, ((Tuple) args).toArray()); } if (args instanceof Object[]) { return invokeMethod(object, name, (Object[]) args); } return invokeMethod(object, name, new Object[] { args }); }