com.alibaba.citrus.util.Assert.unexpectedException()方法的使用及代码示例

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

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

Assert.unexpectedException介绍

[英]不可能发生的异常。
[中]不可能发生的异常。

代码示例

代码示例来源:origin: webx/citrus

/** 不可能发生的异常。 */
public static <T> T unexpectedException(Throwable e) {
  unexpectedException(e, null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

/** 不可能发生的异常。 */
public static <T> T unexpectedException(Throwable e) {
  unexpectedException(e, null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

/** 不可能发生的异常。 */
public static <T> T unexpectedException(Throwable e) {
  unexpectedException(e, null, (Object[]) null);
  return null;
}

代码示例来源:origin: webx/citrus

@Override
public Object clone() {
  try {
    return super.clone();
  } catch (CloneNotSupportedException e) {
    unexpectedException(e);
    return null;
  }
}

代码示例来源:origin: webx/citrus

@Override
  public final AttachmentSource clone() {
    try {
      return (AttachmentSource) super.clone();
    } catch (CloneNotSupportedException e) {
      unexpectedException(e);
      return null;
    }
  }
}

代码示例来源:origin: webx/citrus

@Override
public Object clone() {
  try {
    return super.clone();
  } catch (CloneNotSupportedException e) {
    unexpectedException(e);
    return null;
  }
}

代码示例来源:origin: webx/citrus

@Override
public Object clone() {
  try {
    return super.clone();
  } catch (CloneNotSupportedException e) {
    unexpectedException(e);
    return null;
  }
}

代码示例来源:origin: webx/citrus

@Override
public Object clone() {
  try {
    return super.clone();
  } catch (CloneNotSupportedException e) {
    unexpectedException(e);
    return null;
  }
}

代码示例来源:origin: webx/citrus

/** 创建factory,但避免在compile时刻依赖impl package。 */
  private static Factory newFactory() {
    String factoryImplName = Factory.class.getPackage().getName() + ".impl.TypeInfoFactory";
    Factory factoryImpl = null;
    try {
      factoryImpl = (Factory) Factory.class.getClassLoader().loadClass(factoryImplName).newInstance();
    } catch (Exception e) {
      unexpectedException(e, "Failed to create TypeInfo.Factory");
    }
    return factoryImpl;
  }
}

代码示例来源:origin: webx/citrus

/** 创建factory,但避免在compile时刻依赖impl package。 */
  private static Factory newFactory() {
    String factoryImplName = Factory.class.getPackage().getName() + ".impl.TypeInfoFactory";
    Factory factoryImpl = null;
    try {
      factoryImpl = (Factory) Factory.class.getClassLoader().loadClass(factoryImplName).newInstance();
    } catch (Exception e) {
      unexpectedException(e, "Failed to create TypeInfo.Factory");
    }
    return factoryImpl;
  }
}

代码示例来源:origin: webx/citrus

public String tree() {
  StringWriter sw = new StringWriter();
  try {
    tree(sw);
  } catch (IOException e) {
    unexpectedException(e);
  }
  return sw.toString();
}

代码示例来源:origin: webx/citrus

/** 输出DOM。 */
public static byte[] getDocumentContent(Document doc) {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  try {
    writeDocument(doc, baos, null);
  } catch (IOException e) {
    unexpectedException(e); // 此调用不太可能报IO错
  }
  return baos.toByteArray();
}

代码示例来源:origin: webx/citrus

/** 将列表中的对象连接起来。 */
public static void join(StringBuilder buf, Iterable<?> objs, String sep) {
  try {
    join((Appendable) buf, objs, sep);
  } catch (IOException e) {
    unexpectedException(e);
  }
}

代码示例来源:origin: webx/citrus

/** 输出DOM。 */
public static byte[] getDocumentContent(Document doc) {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  try {
    writeDocument(doc, baos, null);
  } catch (IOException e) {
    unexpectedException(e); // 此调用不太可能报IO错
  }
  return baos.toByteArray();
}

代码示例来源:origin: webx/citrus

public String tree() {
  StringWriter sw = new StringWriter();
  try {
    tree(sw);
  } catch (IOException e) {
    unexpectedException(e);
  }
  return sw.toString();
}

代码示例来源:origin: webx/citrus

/** 输出DOM。 */
public static String getDocumentText(Document doc, String charset) {
  StringWriter writer = new StringWriter();
  try {
    writeDocument(doc, writer, charset);
  } catch (IOException e) {
    // 不会发生
    unexpectedException(e);
  }
  return writer.toString();
}

代码示例来源:origin: webx/citrus

/** 将javamail邮件对象转换成文本形式,其格式为标准的<code>.eml</code>格式。 */
public static String toString(Message message) throws MessagingException {
  try {
    return toString(message, null);
  } catch (UnsupportedEncodingException e) {
    unexpectedException(e);
    return null;
  }
}

代码示例来源:origin: webx/citrus

public String tree() {
  StringWriter sw = new StringWriter();
  try {
    tree(sw);
  } catch (IOException e) {
    unexpectedException(e);
  }
  return sw.toString();
}

代码示例来源:origin: webx/citrus

/** 输出DOM。 */
public static String getDocumentText(Document doc, String charset) {
  StringWriter writer = new StringWriter();
  try {
    writeDocument(doc, writer, charset);
  } catch (IOException e) {
    // 不会发生
    unexpectedException(e);
  }
  return writer.toString();
}

代码示例来源:origin: webx/citrus

/** 将列表中的对象连接起来。 */
public static void join(StringBuilder buf, Iterable<?> objs, String sep) {
  try {
    join((Appendable) buf, objs, sep);
  } catch (IOException e) {
    unexpectedException(e);
  }
}

相关文章