Top Description Inners Fields Methods
org.easymock.bytebuddy.description

public Interface ByteCodeElement

extends WithRuntimeName, WithDescriptor, OfByteCodeElement, DeclaredByType, AnnotationSource
Known Direct Subinterfaces
org.easymock.bytebuddy.description.ByteCodeElement.Member, org.easymock.bytebuddy.description.field.FieldDescription, org.easymock.bytebuddy.description.type.TypeDescription
Imports
org.easymock.bytebuddy.description.annotation.AnnotationSource, org.easymock.bytebuddy.description.type.TypeDescription, org.easymock.bytebuddy.matcher.ElementMatcher, .FilterableList, java.util.ArrayList, .Arrays, .List

Implementations describe an element represented in byte code, i.e. a type, a field or a method or a constructor.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ByteCodeElement.Member

A byte code element that is declared by a type.

public static interface
ByteCodeElement.Token<
The type of the implementation.
T extends ByteCodeElement.Token<T>
>

A token representing a byte code element.

public static interface
ByteCodeElement.TypeDependant<
The type dependant's type.
T extends ByteCodeElement.TypeDependant<?, S>
,
The type dependant's token type.
S extends ByteCodeElement.Token<S>
>

A type dependant describes an element that is an extension of a type definition, i.e. a field, method or method parameter.

Field Summary

Inherited from org.easymock.bytebuddy.description.NamedElement.WithDescriptor:
NON_GENERIC_SIGNATURE

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this element is accessible for typeDescription.
isAccessibleTo
(TypeDescription
The type which is checked for its accessibility of this element.
typeDescription
)

Checks if this element is accessible from a given type.

public boolean

Returns:

true if this element is visible for typeDescription.
isVisibleTo
(TypeDescription
The type which is checked for its visibility of this element.
typeDescription
)

Checks if this element is visible from a given type.

Inherited from org.easymock.bytebuddy.description.annotation.AnnotationSource:
getDeclaredAnnotations
Inherited from org.easymock.bytebuddy.description.DeclaredByType:
getDeclaringType
Inherited from org.easymock.bytebuddy.description.ModifierReviewable.OfByteCodeElement:
getOwnershipgetVisibilityisDeprecatedisPackagePrivateisPrivateisProtectedisPublicisStatic
Inherited from org.easymock.bytebuddy.description.NamedElement.WithDescriptor:
getDescriptorgetGenericSignature
Inherited from org.easymock.bytebuddy.description.NamedElement.WithRuntimeName:
getInternalNamegetName

Method Detail

isAccessibleToback to summary
public boolean isAccessibleTo(TypeDescription typeDescription)

Checks if this element is accessible from a given type. Accessibility is a more narrow criteria then visibility which can be checked by ByteCodeElement#isVisibleTo(TypeDescription). Accessibility allows the invocation of a method on external instances or on itself. Methods that can be invoked from within an instance might however not be considered accessible.

Note

A method or field might define a signature that includes types that are not visible to a type. Such methods can be legally invoked from this type and can even be implemented as bridge methods by this type. It is however not legal to declare a method with invisible types in its signature that are not bridges what might require additional validation.

Important Note

Virtual byte code elements, i.e. virtual methods, are only considered visible if the type they are invoked upon is visible to a given type. The visibility of such virtual members can therefore not be determined by only investigating the invoked method but requires an additional check of the target type.

Parameters
typeDescription:TypeDescription

The type which is checked for its accessibility of this element.

Returns:boolean

true if this element is accessible for typeDescription.

isVisibleToback to summary
public boolean isVisibleTo(TypeDescription typeDescription)

Checks if this element is visible from a given type. Visibility is a wider criteria then accessibility which can be checked by ByteCodeElement#isAccessibleTo(TypeDescription). Visibility allows the invocation of a method on itself or on external instances.

Note

A method or field might define a signature that includes types that are not visible to a type. Such methods can be legally invoked from this type and can even be implemented as bridge methods by this type. It is however not legal to declare a method with invisible types in its signature that are not bridges what might require additional validation.

Important Note

Virtual byte code elements, i.e. virtual methods, are only considered visible if the type they are invoked upon is visible to a given type. The visibility of such virtual members can therefore not be determined by only investigating the invoked method but requires an additional check of the target type.

Parameters
typeDescription:TypeDescription

The type which is checked for its visibility of this element.

Returns:boolean

true if this element is visible for typeDescription.

org.easymock.bytebuddy.description back to summary

public Interface ByteCodeElement.Member

extends WithMandatoryDeclaration, ByteCodeElement, WithGenericName
Known Direct Subinterfaces
org.easymock.bytebuddy.description.field.FieldDescription, org.easymock.bytebuddy.description.method.MethodDescription

A byte code element that is declared by a type.

Method Summary

Inherited from org.easymock.bytebuddy.description.ByteCodeElement:
isAccessibleToisVisibleTo
Inherited from org.easymock.bytebuddy.description.DeclaredByType.WithMandatoryDeclaration:
getDeclaringType
Inherited from org.easymock.bytebuddy.description.NamedElement.WithGenericName:
toGenericString
org.easymock.bytebuddy.description back to summary

public Interface ByteCodeElement.Token<T extends ByteCodeElement.Token<T>>

Known Direct Implementers
org.easymock.bytebuddy.description.field.FieldDescription.Token, org.easymock.bytebuddy.description.method.MethodDescription.Token, org.easymock.bytebuddy.description.method.ParameterDescription.Token, org.easymock.bytebuddy.description.type.RecordComponentDescription.Token, org.easymock.bytebuddy.description.type.TypeVariableToken
Type Parameters
<T>
The type of the implementation.

A token representing a byte code element.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ByteCodeElement.Token.TokenList<
The actual token type.
S extends ByteCodeElement.Token<S>
>

A list of tokens.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

This token with all of its represented types transformed by the supplied visitor.
accept
(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic>
The visitor to transform all types that are represented by this token.
visitor
)

Transforms the types represented by this token by applying the given visitor to them.

Method Detail

acceptback to summary
public T accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)

Transforms the types represented by this token by applying the given visitor to them.

Parameters
visitor:TypeDescription.Generic.Visitor<? extends TypeDescription.Generic>

The visitor to transform all types that are represented by this token.

Returns:T

This token with all of its represented types transformed by the supplied visitor.

org.easymock.bytebuddy.description back to summary

public Class ByteCodeElement.Token.TokenList<S extends ByteCodeElement.Token<S>>

extends FilterableList.AbstractBase<S extends ByteCodeElement.Token<S>, ByteCodeElement.Token.TokenList<S extends ByteCodeElement.Token<S>>>
Class Inheritance
Type Parameters
<S>
The actual token type.

A list of tokens.

Field Summary

Modifier and TypeField and Description
private final List<? extends S>
tokens

The tokens that this list represents.

Constructor Summary

AccessConstructor and Description
public
TokenList(S...
The tokens that this list represents.
token
)

Creates a list of tokens.

public
TokenList(List<? extends S>
The tokens that this list represents.
tokens
)

Creates a list of tokens.

Method Summary

Modifier and TypeMethod and Description
public ByteCodeElement.Token.TokenList<S>

Returns:

A list containing the transformed tokens.
accept
(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic>
The visitor to apply to all tokens.
visitor
)

Transforms all tokens that are represented by this list.

public S
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
protected ByteCodeElement.Token.TokenList<S>
wrap(List<S>
The values to wrap in an instance of this list's type.
values
)

Implements abstract org.easymock.bytebuddy.matcher.FilterableList.AbstractBase.wrap.

Represents a list of values as an instance of this instance's list type.
Inherited from org.easymock.bytebuddy.matcher.FilterableList.AbstractBase:
filtergetOnlysubList

Field Detail

tokensback to summary
private final List<? extends S> tokens

The tokens that this list represents.

Constructor Detail

TokenListback to summary
public TokenList(S... token)

Creates a list of tokens.

Parameters
token:S[]

The tokens that this list represents.

Annotations
@SuppressWarnings:unchecked
TokenListback to summary
public TokenList(List<? extends S> tokens)

Creates a list of tokens.

Parameters
tokens:List<? extends S>

The tokens that this list represents.

Method Detail

acceptback to summary
public ByteCodeElement.Token.TokenList<S> accept(TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)

Transforms all tokens that are represented by this list.

Parameters
visitor:TypeDescription.Generic.Visitor<? extends TypeDescription.Generic>

The visitor to apply to all tokens.

Returns:ByteCodeElement.Token.TokenList<S>

A list containing the transformed tokens.

getback to summary
public S get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:S

the element at the specified position in this list

sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

wrapback to summary
protected ByteCodeElement.Token.TokenList<S> wrap(List<S> values)

Implements abstract org.easymock.bytebuddy.matcher.FilterableList.AbstractBase.wrap.

Doc from org.easymock.bytebuddy.matcher.FilterableList.AbstractBase.wrap.

Represents a list of values as an instance of this instance's list type.

Parameters
values:List<S>

The values to wrap in an instance of this list's type.

Returns:ByteCodeElement.Token.TokenList<S>

A wrapped instance of the given values.

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

public Interface ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?, S>, S extends ByteCodeElement.Token<S>>

Known Direct Subinterfaces
org.easymock.bytebuddy.description.field.FieldDescription, org.easymock.bytebuddy.description.method.MethodDescription, org.easymock.bytebuddy.description.method.ParameterDescription, org.easymock.bytebuddy.description.type.RecordComponentDescription
Type Parameters
<T>
The type dependant's type.
<S>
The type dependant's token type.

A type dependant describes an element that is an extension of a type definition, i.e. a field, method or method parameter.

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

This type dependant in its defined shape.
asDefined
()

Returns this type dependant in its defined shape, i.e. the form it is declared in and without its type variable's resolved.

public S

Returns:

A token representative of this type dependant.
asToken
(ElementMatcher<? super TypeDescription>
A matcher to identify types to be replaced by org.easymock.bytebuddy.dynamic.TargetType descriptions.
matcher
)

Returns a token representative of this type dependant.

Method Detail

asDefinedback to summary
public T asDefined()

Returns this type dependant in its defined shape, i.e. the form it is declared in and without its type variable's resolved.

Returns:T

This type dependant in its defined shape.

asTokenback to summary
public S asToken(ElementMatcher<? super TypeDescription> matcher)

Returns a token representative of this type dependant. All types that are matched by the supplied matcher are replaced by org.easymock.bytebuddy.dynamic.TargetType descriptions.

Parameters
matcher:ElementMatcher<? super TypeDescription>

A matcher to identify types to be replaced by org.easymock.bytebuddy.dynamic.TargetType descriptions.

Returns:S

A token representative of this type dependant.