Top Description Inners Fields Constructors Methods
org.easymock.bytebuddy.matcher

public Class ModifierMatcher<T extends ModifierReviewable>

extends ElementMatcher.Junction.ForNonNullValues<T extends ModifierReviewable>
Class Inheritance
Annotations
@Enhance
Type Parameters
<T>
The type of the matched entity.
Imports
org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.ModifierReviewable, org.easymock.bytebuddy.jar.asm.Opcodes

An element matcher that matches a byte code element by its modifiers.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ModifierMatcher.Mode

Determines the type of modifier to be matched by a org.easymock.bytebuddy.matcher.ModifierMatcher.

Field Summary

Modifier and TypeField and Description
private final ModifierMatcher.Mode
mode

The matching mode to apply by this modifier matcher.

Constructor Summary

AccessConstructor and Description
public
ModifierMatcher(ModifierMatcher.Mode
The match mode to apply to the matched element's modifier.
mode
)

Creates a new element matcher that matches an element by its modifier.

Method Summary

Modifier and TypeMethod and Description
protected boolean
doMatch(T
The instance to be matched.
target
)

Implements abstract org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Matches the supplied value if it was found not to be null.
public static <
The type of the matched entity.
T extends ModifierReviewable
>
ElementMatcher.Junction<T>

Returns:

A matcher that matches methods of the provided sort.
of
(ModifierMatcher.Mode
The match mode to apply to the matched element's modifier.
mode
)

Returns a new element matcher that matches an element by its modifier.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues:
matches

Field Detail

modeback to summary
private final ModifierMatcher.Mode mode

The matching mode to apply by this modifier matcher.

Constructor Detail

ModifierMatcherback to summary
public ModifierMatcher(ModifierMatcher.Mode mode)

Creates a new element matcher that matches an element by its modifier.

Parameters
mode:ModifierMatcher.Mode

The match mode to apply to the matched element's modifier.

Method Detail

doMatchback to summary
protected boolean doMatch(T target)

Implements abstract org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Doc from org.easymock.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Matches the supplied value if it was found not to be null.

Parameters
target:T

The instance to be matched.

Returns:boolean

true if the given element is matched by this matcher or false otherwise.

ofback to summary
public static <T extends ModifierReviewable> ElementMatcher.Junction<T> of(ModifierMatcher.Mode mode)

Returns a new element matcher that matches an element by its modifier.

Parameters
<T>
The type of the matched entity.
mode:ModifierMatcher.Mode

The match mode to apply to the matched element's modifier.

Returns:ElementMatcher.Junction<T>

A matcher that matches methods of the provided sort.

Annotations
@SuppressWarnings:unchecked
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
org.easymock.bytebuddy.matcher back to summary

public final Enum ModifierMatcher.Mode

extends Enum<ModifierMatcher.Mode>
Class Inheritance

Determines the type of modifier to be matched by a org.easymock.bytebuddy.matcher.ModifierMatcher.

Field Summary

Modifier and TypeField and Description
public static final ModifierMatcher.Mode
ABSTRACT

Matches an element that is considered abstract.

public static final ModifierMatcher.Mode
ANNOTATION

Matches a type that is considered an annotation.

public static final ModifierMatcher.Mode
BRIDGE

Matches an element that is considered a bridge method.

private final String
description

The textual representation of this instance's matching mode.

public static final ModifierMatcher.Mode
ENUMERATION

Matches a type or field for describing an enumeration.

public static final ModifierMatcher.Mode
FINAL

Matches an element that is considered final.

public static final ModifierMatcher.Mode
INTERFACE

Matches a type that is considered an interface.

public static final ModifierMatcher.Mode
MANDATED

Matches a mandated parameter.

private final ModifierMatcher<?>
matcher

The canonical matcher instance.

private final int
modifiers

The mask of the modifier to match.

public static final ModifierMatcher.Mode
NATIVE

Matches an element that is considered native.

public static final ModifierMatcher.Mode
PRIVATE

Matches an element that is considered private.

public static final ModifierMatcher.Mode
PROTECTED

Matches an element that is considered protected.

public static final ModifierMatcher.Mode
PUBLIC

Matches an element that is considered public.

public static final ModifierMatcher.Mode
STATIC

Matches an element that is considered static.

public static final ModifierMatcher.Mode
STRICT

Matches an element that is considered strict.

public static final ModifierMatcher.Mode
SYNCHRONIZED

Matches an element that is considered synchronized.

public static final ModifierMatcher.Mode
SYNTHETIC

Matches an element that is considered synthetic.

public static final ModifierMatcher.Mode
TRANSIENT

Matches a transient field.

public static final ModifierMatcher.Mode
VAR_ARGS

Matches an element that is considered to be varargs.

public static final ModifierMatcher.Mode
VOLATILE

Matches a volatile field.

Constructor Summary

AccessConstructor and Description
private
Mode(int
The mask of the modifier to match.
modifiers
,
String
The textual representation of this instance's matching mode.
description
)

Creates a new modifier matcher mode.

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

The textual description of this mode.
getDescription
()

Returns the textual description of this mode.

protected ModifierMatcher<?>

Returns:

A reusable matcher for this modifier sort.
getMatcher
()

Returns a reusable matcher for this modifier sort.

protected int

Returns:

The modifiers to match by this mode.
getModifiers
()

Returns the modifiers to match by this mode.

public static ModifierMatcher.Mode
public static ModifierMatcher.Mode[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ABSTRACTback to summary
public static final ModifierMatcher.Mode ABSTRACT

Matches an element that is considered abstract.

ANNOTATIONback to summary
public static final ModifierMatcher.Mode ANNOTATION

Matches a type that is considered an annotation.

BRIDGEback to summary
public static final ModifierMatcher.Mode BRIDGE

Matches an element that is considered a bridge method.

descriptionback to summary
private final String description

The textual representation of this instance's matching mode.

ENUMERATIONback to summary
public static final ModifierMatcher.Mode ENUMERATION

Matches a type or field for describing an enumeration.

FINALback to summary
public static final ModifierMatcher.Mode FINAL

Matches an element that is considered final.

INTERFACEback to summary
public static final ModifierMatcher.Mode INTERFACE

Matches a type that is considered an interface.

MANDATEDback to summary
public static final ModifierMatcher.Mode MANDATED

Matches a mandated parameter.

matcherback to summary
private final ModifierMatcher<?> matcher

The canonical matcher instance.

modifiersback to summary
private final int modifiers

The mask of the modifier to match.

NATIVEback to summary
public static final ModifierMatcher.Mode NATIVE

Matches an element that is considered native.

PRIVATEback to summary
public static final ModifierMatcher.Mode PRIVATE

Matches an element that is considered private.

PROTECTEDback to summary
public static final ModifierMatcher.Mode PROTECTED

Matches an element that is considered protected.

PUBLICback to summary
public static final ModifierMatcher.Mode PUBLIC

Matches an element that is considered public.

STATICback to summary
public static final ModifierMatcher.Mode STATIC

Matches an element that is considered static.

STRICTback to summary
public static final ModifierMatcher.Mode STRICT

Matches an element that is considered strict.

SYNCHRONIZEDback to summary
public static final ModifierMatcher.Mode SYNCHRONIZED

Matches an element that is considered synchronized.

SYNTHETICback to summary
public static final ModifierMatcher.Mode SYNTHETIC

Matches an element that is considered synthetic.

TRANSIENTback to summary
public static final ModifierMatcher.Mode TRANSIENT

Matches a transient field.

VAR_ARGSback to summary
public static final ModifierMatcher.Mode VAR_ARGS

Matches an element that is considered to be varargs.

VOLATILEback to summary
public static final ModifierMatcher.Mode VOLATILE

Matches a volatile field.

Constructor Detail

Modeback to summary
private Mode(int modifiers, String description)

Creates a new modifier matcher mode.

Parameters
modifiers:int

The mask of the modifier to match.

description:String

The textual representation of this instance's matching mode.

Method Detail

getDescriptionback to summary
protected String getDescription()

Returns the textual description of this mode.

Returns:String

The textual description of this mode.

getMatcherback to summary
protected ModifierMatcher<?> getMatcher()

Returns a reusable matcher for this modifier sort.

Returns:ModifierMatcher<?>

A reusable matcher for this modifier sort.

getModifiersback to summary
protected int getModifiers()

Returns the modifiers to match by this mode.

Returns:int

The modifiers to match by this mode.

valueOfback to summary
public static ModifierMatcher.Mode valueOf(String name)
valuesback to summary
public static ModifierMatcher.Mode[] values()