Top Description Fields Constructors Methods
org.easymock.bytebuddy.jar.asm.commons

public Class AnnotationRemapper

extends AnnotationVisitor
Class Inheritance
Imports
org.easymock.bytebuddy.jar.asm.AnnotationVisitor, .Opcodes

An AnnotationVisitor that remaps types with a Remapper.
Author
Eugene Kuleshov

Field Summary

Modifier and TypeField and Description
protected final String
descriptor

The descriptor of the visited annotation.

protected final Remapper
remapper

The remapper used to remap the types in the visited annotation.

Inherited from org.easymock.bytebuddy.jar.asm.AnnotationVisitor:
apiav

Constructor Summary

AccessConstructor and Description
public
AnnotationRemapper(final AnnotationVisitor
the annotation visitor this remapper must delegate to.
annotationVisitor
,
final Remapper
the remapper to use to remap the types in the visited annotation.
remapper
)

Constructs a new AnnotationRemapper.
public
AnnotationRemapper(final String
the descriptor of the visited annotation. May be null.
descriptor
,
final AnnotationVisitor
the annotation visitor this remapper must delegate to.
annotationVisitor
,
final Remapper
the remapper to use to remap the types in the visited annotation.
remapper
)

Constructs a new AnnotationRemapper.

protected
AnnotationRemapper(final int
the ASM API version supported by this remapper. Must be one of the ASMx values in Opcodes.
api
,
final AnnotationVisitor
the annotation visitor this remapper must delegate to.
annotationVisitor
,
final Remapper
the remapper to use to remap the types in the visited annotation.
remapper
)

Constructs a new AnnotationRemapper.
protected
AnnotationRemapper(final int
the ASM API version supported by this remapper. Must be one of the ASMx values in Opcodes.
api
,
final String
the descriptor of the visited annotation. May be null.
descriptor
,
final AnnotationVisitor
the annotation visitor this remapper must delegate to.
annotationVisitor
,
final Remapper
the remapper to use to remap the types in the visited annotation.
remapper
)

Constructs a new AnnotationRemapper.

Method Summary

Modifier and TypeMethod and Description
protected AnnotationVisitor

Returns:

the newly created remapper.
createAnnotationRemapper
(final AnnotationVisitor
the AnnotationVisitor the remapper must delegate to.
annotationVisitor
)

Constructs a new remapper for annotations.
protected AnnotationVisitor

Returns:

the newly created remapper.
createAnnotationRemapper
(final String
the descriptor of the visited annotation.
descriptor
,
final AnnotationVisitor
the AnnotationVisitor the remapper must delegate to.
annotationVisitor
)

Constructs a new remapper for annotations.

private String

Returns:

the new name of the annotation attribute.
mapAnnotationAttributeName
(final String
the name of the annotation attribute.
name
)

Maps an annotation attribute name with the remapper.

pack-priv final AnnotationVisitor

Returns:

either this object, or the given one.
orDeprecatedValue
(final AnnotationVisitor
the result of a call to the deprecated createAnnotationRemapper method.
deprecatedAnnotationVisitor
)

Returns either this object, or the given one.

public void
visit(final String
the value name.
name
,
final Object
the actual value, whose type must be Byte, Boolean, Character, Short, Integer , Long, Float, Double, String or Type of Type#OBJECT or Type#ARRAY sort. This value can also be an array of byte, boolean, short, char, int, long, float or double values (this is equivalent to using visitArray and visiting each array element in turn, but is more convenient).
value
)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visit.

Visits a primitive value of the annotation.
public AnnotationVisitor
visitAnnotation(final String
the value name.
name
,
final String
the class descriptor of the nested annotation class.
descriptor
)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitAnnotation.

Visits a nested annotation value of the annotation.
public AnnotationVisitor
visitArray(final String
the value name.
name
)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitArray.

Visits an array value of the annotation.
public void
visitEnum(final String
the value name.
name
,
final String
the class descriptor of the enumeration class.
descriptor
,
final String
the actual enumeration value.
value
)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitEnum.

Visits an enumeration value of the annotation.
Inherited from org.easymock.bytebuddy.jar.asm.AnnotationVisitor:
getDelegatevisitEnd

Field Detail

descriptorback to summary
protected final String descriptor

The descriptor of the visited annotation. May be null, for instance for AnnotationDefault.

remapperback to summary
protected final Remapper remapper

The remapper used to remap the types in the visited annotation.

Constructor Detail

AnnotationRemapperback to summary
public AnnotationRemapper(final AnnotationVisitor annotationVisitor, final Remapper remapper)

Constructs a new AnnotationRemapper. Subclasses must not use this constructor. Instead, they must use the AnnotationRemapper(int, AnnotationVisitor, Remapper) version.

Parameters
annotationVisitor:AnnotationVisitor

the annotation visitor this remapper must delegate to.

remapper:Remapper

the remapper to use to remap the types in the visited annotation.

Annotations
@Deprecated
AnnotationRemapperback to summary
public AnnotationRemapper(final String descriptor, final AnnotationVisitor annotationVisitor, final Remapper remapper)

Constructs a new AnnotationRemapper. Subclasses must not use this constructor. Instead, they must use the AnnotationRemapper(int, String, AnnotationVisitor, Remapper) version.

Parameters
descriptor:String

the descriptor of the visited annotation. May be null.

annotationVisitor:AnnotationVisitor

the annotation visitor this remapper must delegate to.

remapper:Remapper

the remapper to use to remap the types in the visited annotation.

AnnotationRemapperback to summary
protected AnnotationRemapper(final int api, final AnnotationVisitor annotationVisitor, final Remapper remapper)

Constructs a new AnnotationRemapper.

Parameters
api:int

the ASM API version supported by this remapper. Must be one of the ASMx values in Opcodes.

annotationVisitor:AnnotationVisitor

the annotation visitor this remapper must delegate to.

remapper:Remapper

the remapper to use to remap the types in the visited annotation.

Annotations
@Deprecated
AnnotationRemapperback to summary
protected AnnotationRemapper(final int api, final String descriptor, final AnnotationVisitor annotationVisitor, final Remapper remapper)

Constructs a new AnnotationRemapper.

Parameters
api:int

the ASM API version supported by this remapper. Must be one of the ASMx values in Opcodes.

descriptor:String

the descriptor of the visited annotation. May be null.

annotationVisitor:AnnotationVisitor

the annotation visitor this remapper must delegate to.

remapper:Remapper

the remapper to use to remap the types in the visited annotation.

Method Detail

createAnnotationRemapperback to summary
protected AnnotationVisitor createAnnotationRemapper(final AnnotationVisitor annotationVisitor)

Constructs a new remapper for annotations. The default implementation of this method returns a new AnnotationRemapper.

Parameters
annotationVisitor:AnnotationVisitor

the AnnotationVisitor the remapper must delegate to.

Returns:AnnotationVisitor

the newly created remapper.

Annotations
@Deprecated
createAnnotationRemapperback to summary
protected AnnotationVisitor createAnnotationRemapper(final String descriptor, final AnnotationVisitor annotationVisitor)

Constructs a new remapper for annotations. The default implementation of this method returns a new AnnotationRemapper.

Parameters
descriptor:String

the descriptor of the visited annotation.

annotationVisitor:AnnotationVisitor

the AnnotationVisitor the remapper must delegate to.

Returns:AnnotationVisitor

the newly created remapper.

mapAnnotationAttributeNameback to summary
private String mapAnnotationAttributeName(final String name)

Maps an annotation attribute name with the remapper. Returns the original name unchanged if the descriptor of the annotation is null.

Parameters
name:String

the name of the annotation attribute.

Returns:String

the new name of the annotation attribute.

orDeprecatedValueback to summary
pack-priv final AnnotationVisitor orDeprecatedValue(final AnnotationVisitor deprecatedAnnotationVisitor)

Returns either this object, or the given one. If the given object is equal to the object returned by the default implementation of the deprecated createAnnotationRemapper method, meaning that this method has not been overridden (or only in minor ways, for instance to add logging), then we can return this object instead, supposed to have been created by the new createAnnotationRemapper method. Otherwise we must return the given object.

Parameters
deprecatedAnnotationVisitor:AnnotationVisitor

the result of a call to the deprecated createAnnotationRemapper method.

Returns:AnnotationVisitor

either this object, or the given one.

visitback to summary
public void visit(final String name, final Object value)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visit.

Doc from org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visit.

Visits a primitive value of the annotation.

Parameters
name:String

the value name.

value:Object

the actual value, whose type must be Byte, Boolean, Character, Short, Integer , Long, Float, Double, String or Type of Type#OBJECT or Type#ARRAY sort. This value can also be an array of byte, boolean, short, char, int, long, float or double values (this is equivalent to using visitArray and visiting each array element in turn, but is more convenient).

Annotations
@Override
visitAnnotationback to summary
public AnnotationVisitor visitAnnotation(final String name, final String descriptor)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitAnnotation.

Doc from org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitAnnotation.

Visits a nested annotation value of the annotation.

Parameters
name:String

the value name.

descriptor:String

the class descriptor of the nested annotation class.

Returns:AnnotationVisitor

a visitor to visit the actual nested annotation value, or null if this visitor is not interested in visiting this nested annotation. The nested annotation value must be fully visited before calling other methods on this annotation visitor.

Annotations
@Override
visitArrayback to summary
public AnnotationVisitor visitArray(final String name)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitArray.

Doc from org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitArray.

Visits an array value of the annotation. Note that arrays of primitive values (such as byte, boolean, short, char, int, long, float or double) can be passed as value to visit. This is what ClassReader does for non empty arrays of primitive values.

Parameters
name:String

the value name.

Returns:AnnotationVisitor

a visitor to visit the actual array value elements, or null if this visitor is not interested in visiting these values. The 'name' parameters passed to the methods of this visitor are ignored. All the array values must be visited before calling other methods on this annotation visitor.

Annotations
@Override
visitEnumback to summary
public void visitEnum(final String name, final String descriptor, final String value)

Overrides org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitEnum.

Doc from org.easymock.bytebuddy.jar.asm.AnnotationVisitor.visitEnum.

Visits an enumeration value of the annotation.

Parameters
name:String

the value name.

descriptor:String

the class descriptor of the enumeration class.

value:String

the actual enumeration value.

Annotations
@Override