Top Description Inners Methods
net.bytebuddy.description.annotation

public Interface AnnotationList

extends FilterableList<AnnotationDescription, AnnotationList>
Known Direct Implementers
net.bytebuddy.description.annotation.AnnotationList.AbstractBase, net.bytebuddy.description.annotation.AnnotationList.Empty
Imports
net.bytebuddy.description.type.TypeDescription, .TypeList, net.bytebuddy.matcher.ElementMatcher, .FilterableList, net.bytebuddy.utility.nullability.AlwaysNull, .MaybeNull, java.lang.annotation.Annotation, .RetentionPolicy, java.util.ArrayList, .Arrays, .Collections, .List, .Set

Defines a list of annotation instances.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
AnnotationList.AbstractBase

An abstract base implementation of an annotation list.

public static class
AnnotationList.Empty

Represents an empty annotation list.

public static class
AnnotationList.Explicit

Represents a list of explicitly provided annotation descriptions.

public static class
AnnotationList.ForLoadedAnnotations

Describes an array of loaded java.lang.annotation.Annotations as an annotation list.

Method Summary

Modifier and TypeMethod and Description
public TypeList

Returns:

A list of the annotation types of this list.
asTypeList
()

Returns a list of the annotation types of this list.

public List<String>

Returns:

A list of binary names of the represented annotations.
asTypeNames
()

Returns a list of the names of the annotation types.

public AnnotationList

Returns:

A list of all inherited annotations besides of the given ignored types.
inherited
(Set<? extends TypeDescription>
A list of annotation types to be ignored from the lookup.
ignoredTypes
)

Returns only annotations that are marked as java.lang.annotation.Inherited as long as they are not contained by the set of ignored annotation types.

public boolean

Returns:

true if the list contains the annotation type.
isAnnotationPresent
(Class<? extends Annotation>
The type to find in the list.
annotationType
)

Checks if this list contains an annotation of the given type.

public boolean

Returns:

true if the list contains the annotation type.
isAnnotationPresent
(TypeDescription
The type to find in the list.
annotationType
)

Checks if this list contains an annotation of the given type.

public <
The annotation type.
T extends Annotation
>
AnnotationDescription.Loadable<T>

Returns:

The annotation description or null if no such annotation was found.
ofType
(Class<T>
The type to be found in the list.
annotationType
)

Finds the first annotation of the given type and returns it.

public AnnotationDescription

Returns:

The annotation description or null if no such annotation was found.
ofType
(TypeDescription
The type to be found in the list.
annotationType
)

Finds the first annotation of the given type and returns it.

public AnnotationList

Returns:

A of annotations only with elements
visibility
(ElementMatcher<? super RetentionPolicy>
A matcher for the required retention policy.
matcher
)

Only retains annotations with the given retention policy.

Inherited from net.bytebuddy.matcher.FilterableList:
filtergetOnlysubList

Method Detail

asTypeListback to summary
public TypeList asTypeList()

Returns a list of the annotation types of this list.

Returns:TypeList

A list of the annotation types of this list.

asTypeNamesback to summary
public List<String> asTypeNames()

Returns a list of the names of the annotation types. This list might contain the names of annotations that are not otherwise resolvable.

Returns:List<String>

A list of binary names of the represented annotations.

inheritedback to summary
public AnnotationList inherited(Set<? extends TypeDescription> ignoredTypes)

Returns only annotations that are marked as java.lang.annotation.Inherited as long as they are not contained by the set of ignored annotation types.

Parameters
ignoredTypes:Set<? extends TypeDescription>

A list of annotation types to be ignored from the lookup.

Returns:AnnotationList

A list of all inherited annotations besides of the given ignored types.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)

Checks if this list contains an annotation of the given type.

Parameters
annotationType:Class<? extends Annotation>

The type to find in the list.

Returns:boolean

true if the list contains the annotation type.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(TypeDescription annotationType)

Checks if this list contains an annotation of the given type.

Parameters
annotationType:TypeDescription

The type to find in the list.

Returns:boolean

true if the list contains the annotation type.

ofTypeback to summary
public <T extends Annotation> AnnotationDescription.Loadable<T> ofType(Class<T> annotationType)

Finds the first annotation of the given type and returns it.

Parameters
<T>
The annotation type.
annotationType:Class<T>

The type to be found in the list.

Returns:AnnotationDescription.Loadable<T>

The annotation description or null if no such annotation was found.

Annotations
@MaybeNull
ofTypeback to summary
public AnnotationDescription ofType(TypeDescription annotationType)

Finds the first annotation of the given type and returns it.

Parameters
annotationType:TypeDescription

The type to be found in the list.

Returns:AnnotationDescription

The annotation description or null if no such annotation was found.

visibilityback to summary
public AnnotationList visibility(ElementMatcher<? super RetentionPolicy> matcher)

Only retains annotations with the given retention policy.

Parameters
matcher:ElementMatcher<? super RetentionPolicy>

A matcher for the required retention policy.

Returns:AnnotationList

A of annotations only with elements

net.bytebuddy.description.annotation back to summary

public abstract Class AnnotationList.AbstractBase

extends FilterableList.AbstractBase<AnnotationDescription, AnnotationList>
implements AnnotationList
Class Inheritance
All Implemented Interfaces
net.bytebuddy.description.annotation.AnnotationList, net.bytebuddy.matcher.FilterableList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
net.bytebuddy.description.annotation.AnnotationList.ForLoadedAnnotations, net.bytebuddy.description.annotation.AnnotationList.Explicit

An abstract base implementation of an annotation list.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TypeList
asTypeList()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeList.

Returns a list of the annotation types of this list.
public List<String>
asTypeNames()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeNames.

Returns a list of the names of the annotation types.
public AnnotationList
inherited(Set<? extends TypeDescription>
A list of annotation types to be ignored from the lookup.
ignoredTypes
)

Implements net.bytebuddy.description.annotation.AnnotationList.inherited.

Returns only annotations that are marked as java.lang.annotation.Inherited as long as they are not contained by the set of ignored annotation types.
public boolean
isAnnotationPresent(Class<? extends Annotation>
The type to find in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.
public boolean
isAnnotationPresent(TypeDescription
The type to find in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.
public <T extends Annotation> AnnotationDescription.Loadable<T>
ofType(Class<T>
The type to be found in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.
public AnnotationDescription
ofType(TypeDescription
The type to be found in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.
public AnnotationList
visibility(ElementMatcher<? super RetentionPolicy>
A matcher for the required retention policy.
matcher
)

Implements net.bytebuddy.description.annotation.AnnotationList.visibility.

Only retains annotations with the given retention policy.
protected AnnotationList
wrap(List<AnnotationDescription>
The values to wrap in an instance of this list's type.
values
)

Implements abstract net.bytebuddy.matcher.FilterableList.AbstractBase.wrap.

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

Constructor Detail

AbstractBaseback to summary
public AbstractBase()

Method Detail

asTypeListback to summary
public TypeList asTypeList()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeList.

Doc from net.bytebuddy.description.annotation.AnnotationList.asTypeList.

Returns a list of the annotation types of this list.

Returns:TypeList

A list of the annotation types of this list.

asTypeNamesback to summary
public List<String> asTypeNames()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeNames.

Doc from net.bytebuddy.description.annotation.AnnotationList.asTypeNames.

Returns a list of the names of the annotation types. This list might contain the names of annotations that are not otherwise resolvable.

Returns:List<String>

A list of binary names of the represented annotations.

inheritedback to summary
public AnnotationList inherited(Set<? extends TypeDescription> ignoredTypes)

Implements net.bytebuddy.description.annotation.AnnotationList.inherited.

Doc from net.bytebuddy.description.annotation.AnnotationList.inherited.

Returns only annotations that are marked as java.lang.annotation.Inherited as long as they are not contained by the set of ignored annotation types.

Parameters
ignoredTypes:Set<? extends TypeDescription>

A list of annotation types to be ignored from the lookup.

Returns:AnnotationList

A list of all inherited annotations besides of the given ignored types.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Doc from net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.

Parameters
annotationType:Class<? extends Annotation>

The type to find in the list.

Returns:boolean

true if the list contains the annotation type.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(TypeDescription annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Doc from net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.

Parameters
annotationType:TypeDescription

The type to find in the list.

Returns:boolean

true if the list contains the annotation type.

ofTypeback to summary
public <T extends Annotation> AnnotationDescription.Loadable<T> ofType(Class<T> annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Doc from net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.

Parameters
<T>
The annotation type.
annotationType:Class<T>

The type to be found in the list.

Returns:AnnotationDescription.Loadable<T>

The annotation description or null if no such annotation was found.

Annotations
@SuppressWarnings:unchecked
@MaybeNull
ofTypeback to summary
public AnnotationDescription ofType(TypeDescription annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Doc from net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.

Parameters
annotationType:TypeDescription

The type to be found in the list.

Returns:AnnotationDescription

The annotation description or null if no such annotation was found.

Annotations
@MaybeNull
visibilityback to summary
public AnnotationList visibility(ElementMatcher<? super RetentionPolicy> matcher)

Implements net.bytebuddy.description.annotation.AnnotationList.visibility.

Doc from net.bytebuddy.description.annotation.AnnotationList.visibility.

Only retains annotations with the given retention policy.

Parameters
matcher:ElementMatcher<? super RetentionPolicy>

A matcher for the required retention policy.

Returns:AnnotationList

A of annotations only with elements

wrapback to summary
protected AnnotationList wrap(List<AnnotationDescription> values)

Implements abstract net.bytebuddy.matcher.FilterableList.AbstractBase.wrap.

Doc from net.bytebuddy.matcher.FilterableList.AbstractBase.wrap.

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

Parameters
values:List<AnnotationDescription>

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

Returns:AnnotationList

A wrapped instance of the given values.

Annotations
@Override
net.bytebuddy.description.annotation back to summary

public Class AnnotationList.Empty

extends FilterableList.Empty<AnnotationDescription, AnnotationList>
implements AnnotationList
Class Inheritance
All Implemented Interfaces
net.bytebuddy.description.annotation.AnnotationList, net.bytebuddy.matcher.FilterableList, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable

Represents an empty annotation list.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static List<AnnotationList>

Returns:

A list of empty annotation lists of the given length.
asList
(int
The length of the list.
length
)

Creates a list of empty annotation lists of the given dimension.

public TypeList
asTypeList()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeList.

Returns a list of the annotation types of this list.
public List<String>
asTypeNames()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeNames.

Returns a list of the names of the annotation types.
public AnnotationList
inherited(Set<? extends TypeDescription>
A list of annotation types to be ignored from the lookup.
ignoredTypes
)

Implements net.bytebuddy.description.annotation.AnnotationList.inherited.

Returns only annotations that are marked as java.lang.annotation.Inherited as long as they are not contained by the set of ignored annotation types.
public boolean
isAnnotationPresent(Class<? extends Annotation>
The type to find in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.
public boolean
isAnnotationPresent(TypeDescription
The type to find in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.
public <T extends Annotation> AnnotationDescription.Loadable<T>
ofType(Class<T>
The type to be found in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.
public AnnotationDescription
ofType(TypeDescription
The type to be found in the list.
annotationType
)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.
public AnnotationList
visibility(ElementMatcher<? super RetentionPolicy>
A matcher for the required retention policy.
matcher
)

Implements net.bytebuddy.description.annotation.AnnotationList.visibility.

Only retains annotations with the given retention policy.
Inherited from net.bytebuddy.matcher.FilterableList.Empty:
filtergetgetOnlysizesubList

Constructor Detail

Emptyback to summary
public Empty()

Method Detail

asListback to summary
public static List<AnnotationList> asList(int length)

Creates a list of empty annotation lists of the given dimension.

Parameters
length:int

The length of the list.

Returns:List<AnnotationList>

A list of empty annotation lists of the given length.

asTypeListback to summary
public TypeList asTypeList()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeList.

Doc from net.bytebuddy.description.annotation.AnnotationList.asTypeList.

Returns a list of the annotation types of this list.

Returns:TypeList

A list of the annotation types of this list.

asTypeNamesback to summary
public List<String> asTypeNames()

Implements net.bytebuddy.description.annotation.AnnotationList.asTypeNames.

Doc from net.bytebuddy.description.annotation.AnnotationList.asTypeNames.

Returns a list of the names of the annotation types. This list might contain the names of annotations that are not otherwise resolvable.

Returns:List<String>

A list of binary names of the represented annotations.

inheritedback to summary
public AnnotationList inherited(Set<? extends TypeDescription> ignoredTypes)

Implements net.bytebuddy.description.annotation.AnnotationList.inherited.

Doc from net.bytebuddy.description.annotation.AnnotationList.inherited.

Returns only annotations that are marked as java.lang.annotation.Inherited as long as they are not contained by the set of ignored annotation types.

Parameters
ignoredTypes:Set<? extends TypeDescription>

A list of annotation types to be ignored from the lookup.

Returns:AnnotationList

A list of all inherited annotations besides of the given ignored types.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Doc from net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.

Parameters
annotationType:Class<? extends Annotation>

The type to find in the list.

Returns:boolean

true if the list contains the annotation type.

isAnnotationPresentback to summary
public boolean isAnnotationPresent(TypeDescription annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Doc from net.bytebuddy.description.annotation.AnnotationList.isAnnotationPresent.

Checks if this list contains an annotation of the given type.

Parameters
annotationType:TypeDescription

The type to find in the list.

Returns:boolean

true if the list contains the annotation type.

ofTypeback to summary
public <T extends Annotation> AnnotationDescription.Loadable<T> ofType(Class<T> annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Doc from net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.

Parameters
<T>
The annotation type.
annotationType:Class<T>

The type to be found in the list.

Returns:AnnotationDescription.Loadable<T>

The annotation description or null if no such annotation was found.

Annotations
@SuppressWarnings:unchecked
@AlwaysNull
ofTypeback to summary
public AnnotationDescription ofType(TypeDescription annotationType)

Implements net.bytebuddy.description.annotation.AnnotationList.ofType.

Doc from net.bytebuddy.description.annotation.AnnotationList.ofType.

Finds the first annotation of the given type and returns it.

Parameters
annotationType:TypeDescription

The type to be found in the list.

Returns:AnnotationDescription

The annotation description or null if no such annotation was found.

Annotations
@AlwaysNull
visibilityback to summary
public AnnotationList visibility(ElementMatcher<? super RetentionPolicy> matcher)

Implements net.bytebuddy.description.annotation.AnnotationList.visibility.

Doc from net.bytebuddy.description.annotation.AnnotationList.visibility.

Only retains annotations with the given retention policy.

Parameters
matcher:ElementMatcher<? super RetentionPolicy>

A matcher for the required retention policy.

Returns:AnnotationList

A of annotations only with elements

net.bytebuddy.description.annotation back to summary

public Class AnnotationList.Explicit

extends AbstractBase
Class Inheritance
Known Direct Subclasses
net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.LazyAnnotationDescription.UnresolvedAnnotationList

Represents a list of explicitly provided annotation descriptions.

Field Summary

Modifier and TypeField and Description
private final List<? extends AnnotationDescription>
annotationDescriptions

The list of represented annotation descriptions.

Constructor Summary

AccessConstructor and Description
public
Explicit(AnnotationDescription...
The list of represented annotation descriptions.
annotationDescription
)

Creates a new list of annotation descriptions.

public
Explicit(List<? extends AnnotationDescription>
The list of represented annotation descriptions.
annotationDescriptions
)

Creates a new list of annotation descriptions.

Method Summary

Modifier and TypeMethod and Description
public static List<AnnotationList>

Returns:

The list of annotation lists.
asList
(List<? extends List<? extends AnnotationDescription>>
The list of annotations to represent as a list of annotation lists.
annotations
)

Creates a list of annotation lists for a given multidimensional list of annotation descriptions.

public AnnotationDescription
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.
Inherited from net.bytebuddy.description.annotation.AnnotationList.AbstractBase:
asTypeListasTypeNamesinheritedisAnnotationPresentisAnnotationPresentofTypeofTypevisibilitywrap

Field Detail

annotationDescriptionsback to summary
private final List<? extends AnnotationDescription> annotationDescriptions

The list of represented annotation descriptions.

Constructor Detail

Explicitback to summary
public Explicit(AnnotationDescription... annotationDescription)

Creates a new list of annotation descriptions.

Parameters
annotationDescription:AnnotationDescription[]

The list of represented annotation descriptions.

Explicitback to summary
public Explicit(List<? extends AnnotationDescription> annotationDescriptions)

Creates a new list of annotation descriptions.

Parameters
annotationDescriptions:List<? extends AnnotationDescription>

The list of represented annotation descriptions.

Method Detail

asListback to summary
public static List<AnnotationList> asList(List<? extends List<? extends AnnotationDescription>> annotations)

Creates a list of annotation lists for a given multidimensional list of annotation descriptions.

Parameters
annotations:List<? extends List<? extends AnnotationDescription>>

The list of annotations to represent as a list of annotation lists.

Returns:List<AnnotationList>

The list of annotation lists.

getback to summary
public AnnotationDescription 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:AnnotationDescription

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

net.bytebuddy.description.annotation back to summary

public Class AnnotationList.ForLoadedAnnotations

extends AbstractBase
Class Inheritance

Describes an array of loaded java.lang.annotation.Annotations as an annotation list.

Field Summary

Modifier and TypeField and Description
private final List<? extends Annotation>
annotations

The represented annotations.

Constructor Summary

AccessConstructor and Description
public
ForLoadedAnnotations(Annotation...
The represented annotations.
annotation
)

Creates a new list of loaded annotations.

public
ForLoadedAnnotations(List<? extends Annotation>
The represented annotations.
annotations
)

Creates a new list of loaded annotations.

Method Summary

Modifier and TypeMethod and Description
public static List<AnnotationList>

Returns:

A list of annotation lists representing the given annotations.
asList
(Annotation[][]
The annotations to represent where each dimension is converted into a list.
annotations
)

Creates a list of annotation lists representing the given loaded annotations.

public AnnotationDescription
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.
Inherited from net.bytebuddy.description.annotation.AnnotationList.AbstractBase:
asTypeListasTypeNamesinheritedisAnnotationPresentisAnnotationPresentofTypeofTypevisibilitywrap

Field Detail

annotationsback to summary
private final List<? extends Annotation> annotations

The represented annotations.

Constructor Detail

ForLoadedAnnotationsback to summary
public ForLoadedAnnotations(Annotation... annotation)

Creates a new list of loaded annotations.

Parameters
annotation:Annotation[]

The represented annotations.

ForLoadedAnnotationsback to summary
public ForLoadedAnnotations(List<? extends Annotation> annotations)

Creates a new list of loaded annotations.

Parameters
annotations:List<? extends Annotation>

The represented annotations.

Method Detail

asListback to summary
public static List<AnnotationList> asList(Annotation[][] annotations)

Creates a list of annotation lists representing the given loaded annotations.

Parameters
annotations:Annotation[][]

The annotations to represent where each dimension is converted into a list.

Returns:List<AnnotationList>

A list of annotation lists representing the given annotations.

getback to summary
public AnnotationDescription 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:AnnotationDescription

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