Java Method Call invokeUnwrapException(final Object target, final Method method, @Nullable final Object[] args)

Here you can find the source of invokeUnwrapException(final Object target, final Method method, @Nullable final Object[] args)

Description

invoke Unwrap Exception

License

Apache License

Declaration

@Nullable
    static Object invokeUnwrapException(final Object target, final Method method, @Nullable final Object[] args)
            throws Throwable 

Method Source Code


//package com.java2s;
/*//  www. j  a v a  2  s  . c  o m
 *  Copyright 2013 Sylvain LAURENT
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import javax.annotation.Nullable;

public class Main {
    @Nullable
    static Object invokeUnwrapException(final Object target, final Method method, @Nullable final Object[] args)
            throws Throwable {
        try {
            return method.invoke(target, args);
        } catch (final InvocationTargetException e) {
            throw e.getCause();
        }
    }
}

Related

  1. invokeTarget(Method method, Object obj, Object... args)
  2. invokeTargetCheckPoint(String resuming_checkpoint_path, Object jobObject, final java.util.Map globalMap)
  3. invokeTargetMethods(Object obj, T data, List methods)
  4. invokeToStringMethod(Object value, Class type)
  5. invokeUnchecked(Method method, Object target, Object... arguments)
  6. invokeValue(AnnotatedElement element, Class annotationClass)
  7. invokeVirtual(String methodName, Object onObj, Class[] declaredArgTypes, Object... withArgs)
  8. invokeVirtual(T o, Method method, Object... pa)
  9. invokeVoid(MethodHandle mh)