当前位置: 首页>>代码示例>>Java>>正文


Java InvocationTargetException.getMessage方法代码示例

本文整理汇总了Java中java.lang.reflect.InvocationTargetException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java InvocationTargetException.getMessage方法的具体用法?Java InvocationTargetException.getMessage怎么用?Java InvocationTargetException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.lang.reflect.InvocationTargetException的用法示例。


在下文中一共展示了InvocationTargetException.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setContentAreaForJsonFile

import java.lang.reflect.InvocationTargetException; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
    public void setContentAreaForJsonFile(String str) {
        try {
            final ArrayMap fields = getFields();
            ArrayMap[] methods = getMethods();
            final ArrayMap arrayMap = methods[0];
            final ArrayMap arrayMap2 = methods[1];
//            setCanvasArea(CanvasUIEngine.g().inflateCanvasArea((CanvasHost) this, str, new CanvasUIEngineInflateListener() {
//                public void didInflatedArea(CanvasArea canvasArea, String str) {
//                    if (fields.containsKey(str)) {
//                        Field field = (Field) fields.get(str);
//                        field.setAccessible(true);
//                        try {
//                            field.set(CanvasAreaView.this, canvasArea);
//                        } catch (IllegalAccessException e) {
//                            e.printStackTrace();
//                            throw new RuntimeException(e.getMessage());
//                        }
//                    }
//                    if (arrayMap.containsKey(str)) {
//                        canvasArea.clickListener = CanvasAreaView.getListener((Method) arrayMap.get(str), canvasArea, CanvasAreaView.this);
//                    }
//                    if (arrayMap2.containsKey(str)) {
//                        canvasArea.longClickListener = CanvasAreaView.getLongListener((Method) arrayMap2.get(str), canvasArea, CanvasAreaView.this);
//                    }
//                }
//            }));
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e2) {
            e2.printStackTrace();
            throw new RuntimeException(e2.getMessage());
        } catch (InvocationTargetException e3) {
            e3.printStackTrace();
            throw new RuntimeException(e3.getMessage());
        }
    }
 
开发者ID:xieyangxuejun,项目名称:CommentView,代码行数:39,代码来源:CanvasAreaView.java

示例2: throwRuntimeException

import java.lang.reflect.InvocationTargetException; //导入方法依赖的package包/类
/**
 * Throw a {@link RuntimeException} with given message and cause lifted from an {@link
 * InvocationTargetException}. If the specified {@link InvocationTargetException} does not have a
 * cause, neither will the {@link RuntimeException}.
 */
private static void throwRuntimeException(String msg, InvocationTargetException e) {
  Throwable cause = e.getCause();
  if (cause != null) {
    throw new RuntimeException(msg + ": " + cause.getMessage(), cause);
  } else {
    throw new RuntimeException(msg + ": " + e.getMessage(), e);
  }
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:14,代码来源:Bus.java

示例3: create

import java.lang.reflect.InvocationTargetException; //导入方法依赖的package包/类
/**
 * Creates a DataSerializableFixedID or StreamableFixedID instance by deserializing it from the
 * data input.
 */
public static Object create(int dsfid, DataInput in) throws IOException, ClassNotFoundException {
  switch (dsfid) {
    case REGION:
      return (DataSerializableFixedID) DataSerializer.readRegion(in);
    case END_OF_STREAM_TOKEN:
      return Token.END_OF_STREAM;
    case DLOCK_REMOTE_TOKEN:
      return DLockRemoteToken.createFromDataInput(in);
    case TRANSACTION_ID:
      return TXId.createFromData(in);
    case INTEREST_RESULT_POLICY:
      return readInterestResultPolicy(in);
    case UNDEFINED:
      return readUndefined(in);
    case RESULTS_BAG:
      return readResultsBag(in);
    case TOKEN_INVALID:
      return Token.INVALID;
    case TOKEN_LOCAL_INVALID:
      return Token.LOCAL_INVALID;
    case TOKEN_DESTROYED:
      return Token.DESTROYED;
    case TOKEN_REMOVED:
      return Token.REMOVED_PHASE1;
    case TOKEN_REMOVED2:
      return Token.REMOVED_PHASE2;
    case TOKEN_TOMBSTONE:
      return Token.TOMBSTONE;
    case NULL_TOKEN:
      return readNullToken(in);
    case CONFIGURATION_REQUEST:
      return readConfigurationRequest(in);
    case CONFIGURATION_RESPONSE:
      return readConfigurationResponse(in);
    case PR_DESTROY_ON_DATA_STORE_MESSAGE:
      return readDestroyOnDataStore(in);
    default:
      final Constructor<?> cons;
      if (dsfid >= Byte.MIN_VALUE && dsfid <= Byte.MAX_VALUE) {
        cons = dsfidMap[dsfid + Byte.MAX_VALUE + 1];
      } else {
        cons = (Constructor<?>) dsfidMap2.get(dsfid);
      }
      if (cons != null) {
        try {
          Object ds = cons.newInstance((Object[]) null);
          InternalDataSerializer.invokeFromData(ds, in);
          return ds;
        } catch (InstantiationException ie) {
          throw new IOException(ie.getMessage(), ie);
        } catch (IllegalAccessException iae) {
          throw new IOException(iae.getMessage(), iae);
        } catch (InvocationTargetException ite) {
          Throwable targetEx = ite.getTargetException();
          if (targetEx instanceof IOException) {
            throw (IOException) targetEx;
          } else if (targetEx instanceof ClassNotFoundException) {
            throw (ClassNotFoundException) targetEx;
          } else {
            throw new IOException(ite.getMessage(), targetEx);
          }
        }
      }
      throw new DSFIDNotFoundException("Unknown DataSerializableFixedID: " + dsfid, dsfid);

  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:72,代码来源:DSFIDFactory.java


注:本文中的java.lang.reflect.InvocationTargetException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。