Top Fields Constructors Methods
com.vladsch.flexmark.test.util

public Class ExceptionMatcher

extends BaseMatcher<Throwable>
Class Inheritance
Imports
org.hamcrest.BaseMatcher, .Description, org.jetbrains.annotations.NotNull, java.util.regex.Pattern

Field Summary

Modifier and TypeField and Description
private final @NotNull String
private final @NotNull Pattern
private final @NotNull String

Constructor Summary

AccessConstructor and Description
public
ExceptionMatcher(@NotNull Class<? extends Throwable> throwable, @NotNull Pattern pattern, @NotNull String message)

Method Summary

Modifier and TypeMethod and Description
public void
describeTo(Description
The description to be built or appended to.
description
)

Implements org.hamcrest.SelfDescribing.describeTo.

Generates a description of the object.

public static @NotNull ExceptionMatcher
match(@NotNull Class<? extends Throwable> throwable, @NotNull String text)

public boolean
matches(Object
the object against which the matcher is evaluated.
o
)

Implements org.hamcrest.Matcher.matches.

Evaluates the matcher for argument item.

public static @NotNull ExceptionMatcher
matchPrefix(@NotNull Class<? extends Throwable> throwable, @NotNull String text)

public static @NotNull ExceptionMatcher
matchRegEx(@NotNull Class<? extends Throwable> throwable, @NotNull String regEx)

Inherited from org.hamcrest.BaseMatcher:
_dont_implement_Matcher___instead_extend_BaseMatcher_describeMismatchisNotNulltoString

Field Detail

messageback to summary
private final @NotNull String message
Annotations
@NotNull
patternback to summary
private final @NotNull Pattern pattern
Annotations
@NotNull
prefixback to summary
private final @NotNull String prefix
Annotations
@NotNull

Constructor Detail

ExceptionMatcherback to summary
public ExceptionMatcher(@NotNull Class<? extends Throwable> throwable, @NotNull Pattern pattern, @NotNull String message)

Method Detail

describeToback to summary
public void describeTo(Description description)

Implements org.hamcrest.SelfDescribing.describeTo.

Doc from org.hamcrest.SelfDescribing.describeTo.

Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.

Parameters
description:Description

The description to be built or appended to.

Annotations
@Override
matchback to summary
public static @NotNull ExceptionMatcher match(@NotNull Class<? extends Throwable> throwable, @NotNull String text)
Annotations
@NotNull
matchesback to summary
public boolean matches(Object o)

Implements org.hamcrest.Matcher.matches.

Doc from org.hamcrest.Matcher.matches.

Evaluates the matcher for argument item. This method matches against Object, instead of the generic type T. This is because the caller of the Matcher does not know at runtime what the type is (because of type erasure with Java generics). It is down to the implementations to check the correct type.

Parameters
o:Object

the object against which the matcher is evaluated.

Returns:boolean

true if item matches, otherwise false.

Annotations
@Override
matchPrefixback to summary
public static @NotNull ExceptionMatcher matchPrefix(@NotNull Class<? extends Throwable> throwable, @NotNull String text)
Annotations
@NotNull
matchRegExback to summary
public static @NotNull ExceptionMatcher matchRegEx(@NotNull Class<? extends Throwable> throwable, @NotNull String regEx)
Annotations
@NotNull