org.springframework.expression.AccessException.getCause()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.springframework.expression.AccessException.getCause()方法的一些代码示例,展示了AccessException.getCause()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AccessException.getCause()方法的具体详情如下:
包路径:org.springframework.expression.AccessException
类名称:AccessException
方法名:getCause

AccessException.getCause介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Decode the AccessException, throwing a lightweight evaluation exception or,
 * if the cause was a RuntimeException, throw the RuntimeException directly.
 */
private void throwSimpleExceptionIfPossible(Object value, AccessException ex) {
  if (ex.getCause() instanceof InvocationTargetException) {
    Throwable rootCause = ex.getCause().getCause();
    if (rootCause instanceof RuntimeException) {
      throw (RuntimeException) rootCause;
    }
    throw new ExpressionInvocationTargetException(getStartPosition(),
        "A problem occurred when trying to execute method '" + this.name +
        "' on object of type [" + value.getClass().getName() + "]", rootCause);
  }
}

代码示例来源:origin: org.springframework/spring-expression

/**
 * Decode the AccessException, throwing a lightweight evaluation exception or,
 * if the cause was a RuntimeException, throw the RuntimeException directly.
 */
private void throwSimpleExceptionIfPossible(Object value, AccessException ex) {
  if (ex.getCause() instanceof InvocationTargetException) {
    Throwable rootCause = ex.getCause().getCause();
    if (rootCause instanceof RuntimeException) {
      throw (RuntimeException) rootCause;
    }
    throw new ExpressionInvocationTargetException(getStartPosition(),
        "A problem occurred when trying to execute method '" + this.name +
        "' on object of type [" + value.getClass().getName() + "]", rootCause);
  }
}

代码示例来源:origin: spring-projects/spring-framework

if (ex.getCause() instanceof InvocationTargetException) {
  Throwable rootCause = ex.getCause().getCause();
  if (rootCause instanceof RuntimeException) {
    throw (RuntimeException) rootCause;

代码示例来源:origin: org.springframework/spring-expression

if (ex.getCause() instanceof InvocationTargetException) {
  Throwable rootCause = ex.getCause().getCause();
  if (rootCause instanceof RuntimeException) {
    throw (RuntimeException) rootCause;

代码示例来源:origin: apache/servicemix-bundles

/**
 * Decode the AccessException, throwing a lightweight evaluation exception or,
 * if the cause was a RuntimeException, throw the RuntimeException directly.
 */
private void throwSimpleExceptionIfPossible(Object value, AccessException ex) {
  if (ex.getCause() instanceof InvocationTargetException) {
    Throwable rootCause = ex.getCause().getCause();
    if (rootCause instanceof RuntimeException) {
      throw (RuntimeException) rootCause;
    }
    throw new ExpressionInvocationTargetException(getStartPosition(),
        "A problem occurred when trying to execute method '" + this.name +
        "' on object of type [" + value.getClass().getName() + "]", rootCause);
  }
}

代码示例来源:origin: apache/servicemix-bundles

if (ex.getCause() instanceof InvocationTargetException) {
  Throwable rootCause = ex.getCause().getCause();
  if (rootCause instanceof RuntimeException) {
    throw (RuntimeException) rootCause;

相关文章

微信公众号

最新文章

更多