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

public Class TypeReferenceAdjustment

extends AbstractBase
Class Inheritance
Annotations
@Enhance
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.field.FieldDescription, .FieldList, org.easymock.bytebuddy.description.method.MethodList, org.easymock.bytebuddy.description.type.TypeDescription, org.easymock.bytebuddy.implementation.Implementation, org.easymock.bytebuddy.matcher.ElementMatcher, org.easymock.bytebuddy.pool.TypePool, org.easymock.bytebuddy.utility.OpenedClassReader, org.easymock.bytebuddy.utility.nullability.AlwaysNull, .MaybeNull, org.easymock.bytebuddy.jar.asm.*, java.util.Arrays, .HashSet, .Set

Adds an attribute value for all inner classes that are referenced by the instrumented type. Adding such attributes is formally required by the Java virtual machine specification but it is not enforced by the verifier. As a result, many alternative JVM languages do not correctly implement the attribute. By adding this visitor, a type's inner class attribute can be repaired or created by registering this visitor wrapper.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
TypeReferenceAdjustment.TypeReferenceClassVisitor

A class visitor that collects all type references and all inner class references.

Field Summary

Modifier and TypeField and Description
private final ElementMatcher.Junction<? super TypeDescription>
filter

A filter for excluding types from type reference analysis.

private final boolean
strict

true if the visitor should throw an exception if a type reference cannot be located.

Constructor Summary

AccessConstructor and Description
protected
TypeReferenceAdjustment(boolean
true if the visitor should throw an exception if a type reference cannot be located.
strict
,
ElementMatcher.Junction<? super TypeDescription>
A filter for excluding types from type reference analysis.
filter
)

Creates a type reference adjustment.

Method Summary

Modifier and TypeMethod and Description
public TypeReferenceAdjustment

Returns:

A new type reference adjustment that uses the supplied filter for excluding types.
filter
(ElementMatcher<? super TypeDescription>
A filter for excluding types from the attribute generation.
filter
)

Excludes all matched types from being added as an attribute.

public static TypeReferenceAdjustment

Returns:

A relaxed type reference adjustment.
relaxed
()

Creates a strict type reference adjustment that ignores type references that cannot be resolved in the supplied type pool.

public static TypeReferenceAdjustment

Returns:

A strict type reference adjustment.
strict
()

Creates a strict type reference adjustment that throws an exception if a type reference cannot be resolved in the supplied type pool.

public ClassVisitor
wrap(TypeDescription
The instrumented type.
instrumentedType
,
ClassVisitor
A ClassVisitor to become the new primary class visitor to which the created org.easymock.bytebuddy.dynamic.DynamicType is written to.
classVisitor
,
Implementation.Context
The implementation context of the current instrumentation.
implementationContext
,
TypePool
The type pool that was provided for the class creation.
typePool
,
FieldList<FieldDescription.InDefinedShape>
The instrumented type's fields.
fields
,
MethodList<?>
The instrumented type's methods non-ignored declared and virtually inherited methods.
methods
,
int writerFlags, int readerFlags)

Implements org.easymock.bytebuddy.asm.AsmVisitorWrapper.wrap.

Applies a ClassVisitorWrapper to the creation of a org.easymock.bytebuddy.dynamic.DynamicType.
Inherited from org.easymock.bytebuddy.asm.AsmVisitorWrapper.AbstractBase:
mergeReadermergeWriter