Class ParameterList.ForLoadedExecutable<T>
java.lang.Object
java.util.AbstractCollection<ParameterDescription.InDefinedShape>
java.util.AbstractList<ParameterDescription.InDefinedShape>
net.bytebuddy.matcher.FilterableList.AbstractBase<ParameterDescription.InDefinedShape, ParameterList<ParameterDescription.InDefinedShape>>
net.bytebuddy.description.method.ParameterList.AbstractBase<ParameterDescription.InDefinedShape>
net.bytebuddy.description.method.ParameterList.ForLoadedExecutable<T>
- Type Parameters:
T- The type of thejava.lang.reflect.Executablethat this list represents.
- All Implemented Interfaces:
Iterable<ParameterDescription.InDefinedShape>, Collection<ParameterDescription.InDefinedShape>, List<ParameterDescription.InDefinedShape>, SequencedCollection<ParameterDescription.InDefinedShape>, ParameterList<ParameterDescription.InDefinedShape>, FilterableList<ParameterDescription.InDefinedShape, ParameterList<ParameterDescription.InDefinedShape>>
- Direct Known Subclasses:
ParameterList.ForLoadedExecutable.OfConstructor, ParameterList.ForLoadedExecutable.OfMethod
- Enclosing interface:
ParameterList<T extends ParameterDescription>
public abstract static class ParameterList.ForLoadedExecutable<T>
extends ParameterList.AbstractBase<ParameterDescription.InDefinedShape>
Represents a list of parameters for an executable, i.e. a
Method or Constructor.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceA dispatcher for creating descriptions of parameter lists and for evaluating the size of anjava.lang.reflect.Executable's parameters.protected static classDescribes the list ofConstructorparameters on a modern VM.protected static classRepresents a list of constructor parameters on virtual machines where thejava.lang.reflect.Parametertype is not available.protected static classRepresents a list of method parameters on virtual machines where thejava.lang.reflect.Parametertype is not available.protected static classDescribes the list ofMethodparameters on a modern VM.Nested classes/interfaces inherited from interface FilterableList
FilterableList.AbstractBase<T,S>, FilterableList.Empty<T, S> Nested classes/interfaces inherited from interface ParameterList
ParameterList.AbstractBase<S>, ParameterList.Empty<S>, ParameterList.Explicit<S>, ParameterList.ForLoadedExecutable<T>, ParameterList.ForTokens, ParameterList.TypeSubstituting -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TThe executable for which a parameter list is represented.protected static final ParameterList.ForLoadedExecutable.ExecutableThe dispatcher used creating parameter list instances and for accessingjava.lang.reflect.Executableinstances.The parameter annotation source to query.private intThe number of parameters of this executable, 0 if the size was not yet computed, or -1 if the list is empty.Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForLoadedExecutable(T executable, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new description for a loaded executable. -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> TdoPrivileged(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.of(Constructor<?> constructor) Creates a new list that describes the parameters of the givenConstructor.of(Constructor<?> constructor, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new list that describes the parameters of the givenConstructor.Creates a new list that describes the parameters of the givenMethod.of(Method method, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new list that describes the parameters of the givenMethod.intsize()Methods inherited from class ParameterList.AbstractBase
asDefined, asTokenList, asTypeList, hasExplicitMetaData, wrapMethods inherited from class FilterableList.AbstractBase
filter, getOnly, subListMethods inherited from class AbstractList
add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, setMethods inherited from class AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface FilterableList
filter, getOnly, subListMethods inherited from interface List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, sort, spliterator, toArray, toArray
-
Field Details
-
EXECUTABLE
The dispatcher used creating parameter list instances and for accessingjava.lang.reflect.Executableinstances. -
executable
The executable for which a parameter list is represented. -
parameterAnnotationSource
protected final ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSourceThe parameter annotation source to query. -
size
private int sizeThe number of parameters of this executable, 0 if the size was not yet computed, or -1 if the list is empty. This avoids recomputation what can lead to an unreasonable performance impact if placed on a hot execution path. This field is not volatile as the result is stable and can be recomputed from different threads.
-
-
Constructor Details
-
ForLoadedExecutable
protected ForLoadedExecutable(T executable, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new description for a loaded executable.- Parameters:
executable- The executable for which a parameter list is represented.parameterAnnotationSource- The parameter annotation source to query.
-
-
Method Details
-
doPrivileged
A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.- Type Parameters:
T- The type of the action's resolved value.- Parameters:
action- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-
of
Creates a new list that describes the parameters of the givenConstructor.- Parameters:
constructor- The constructor for which the parameters should be described.- Returns:
- A list describing the constructor's parameters.
-
of
public static ParameterList<ParameterDescription.InDefinedShape> of(Constructor<?> constructor, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new list that describes the parameters of the givenConstructor.- Parameters:
constructor- The constructor for which the parameters should be described.parameterAnnotationSource- The parameter annotation source to query.- Returns:
- A list describing the constructor's parameters.
-
of
Creates a new list that describes the parameters of the givenMethod.- Parameters:
method- The method for which the parameters should be described.- Returns:
- A list describing the method's parameters.
-
of
public static ParameterList<ParameterDescription.InDefinedShape> of(Method method, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new list that describes the parameters of the givenMethod.- Parameters:
method- The method for which the parameters should be described.parameterAnnotationSource- The parameter annotation source to query.- Returns:
- A list describing the method's parameters.
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<ParameterDescription.InDefinedShape>
-