Class ParameterDescription.ForLoadedParameter<T extends AccessibleObject>
java.lang.Object
net.bytebuddy.description.ModifierReviewable.AbstractBase
net.bytebuddy.description.method.ParameterDescription.AbstractBase
net.bytebuddy.description.method.ParameterDescription.InDefinedShape.AbstractBase
net.bytebuddy.description.method.ParameterDescription.ForLoadedParameter<T>
- Type Parameters:
T- The type of thejava.lang.reflect.Executablethat this list represents.
- All Implemented Interfaces:
AnnotationSource, ByteCodeElement.TypeDependant<ParameterDescription.InDefinedShape, ParameterDescription.Token>, ParameterDescription, ParameterDescription.InDefinedShape, ModifierReviewable, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatable, NamedElement, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
- Direct Known Subclasses:
ParameterDescription.ForLoadedParameter.OfConstructor, ParameterDescription.ForLoadedParameter.OfMethod
- Enclosing interface:
ParameterDescription
public abstract static class ParameterDescription.ForLoadedParameter<T extends AccessibleObject>
extends ParameterDescription.InDefinedShape.AbstractBase
Description of a loaded parameter with support for the information exposed by
java.lang.reflect.Parameter.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA description of a loadedConstructorparameter for a modern VM.protected static classDescription of a loaded constructor's parameter on a virtual machine wherejava.lang.reflect.Parameteris not available.protected static classDescription of a loaded method's parameter on a virtual machine wherejava.lang.reflect.Parameteris not available.protected static classA description of a loadedMethodparameter for a modern VM.protected static interfaceA proxy for ajava.lang.reflect.Parameter.static interfaceA source for querying parameter annotations.Nested classes/interfaces inherited from interface AnnotationSource
AnnotationSource.Empty, AnnotationSource.ExplicitNested classes/interfaces inherited from interface ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatableNested classes/interfaces inherited from interface NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameNested classes/interfaces inherited from interface ParameterDescription
ParameterDescription.AbstractBase, ParameterDescription.ForLoadedParameter<T>, ParameterDescription.InDefinedShape, ParameterDescription.InGenericShape, ParameterDescription.Latent, ParameterDescription.Token, ParameterDescription.TypeSubstitutingNested classes/interfaces inherited from interface ParameterDescription.InDefinedShape
ParameterDescription.InDefinedShape.AbstractBase -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TThejava.lang.reflect.Executablefor which the parameter types are described.protected final intThe parameter's index.private static final StringThe name of thejava.lang.reflect.MalformedParametersException.private static final ParameterDescription.ForLoadedParameter.ParameterA dispatcher for reading properties fromjava.lang.reflect.Parameterinstances.The parameter annotation source to query.Fields inherited from interface ModifierReviewable
EMPTY_MASKFields inherited from interface NamedElement
EMPTY_NAME, NO_NAMEFields inherited from interface ParameterDescription
NAME_PREFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForLoadedParameter(T executable, int index, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new description for a loaded parameter. -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> TdoPrivileged(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.intgetIndex()Returns this parameter's index.intReturns the modifier that is described by this object.getName()Returns the binary name of this byte code element.booleanChecks if this parameter has an explicit modifier.booleanisNamed()Returnstrueif this element has an explicit name.Methods inherited from class ParameterDescription.InDefinedShape.AbstractBase
asDefinedMethods inherited from class ParameterDescription.AbstractBase
asToken, equals, getActualName, getInternalName, getOffset, hashCode, toStringMethods inherited from class ModifierReviewable.AbstractBase
getEnumerationState, getFieldManifestation, getFieldPersistence, getMandate, getMethodManifestation, getMethodStrictness, getOpenness, getOwnership, getParameterManifestation, getProvisioningState, getRequiredPhase, getSynchronizationState, getSyntheticState, getTransitivity, getTypeManifestation, getVisibility, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isOpen, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStaticPhase, isStrict, isSynchronized, isSynthetic, isTransient, isTransitive, isVarArgs, isVolatileMethods inherited from interface AnnotationSource
getDeclaredAnnotationsMethods inherited from interface ByteCodeElement.TypeDependant
asTokenMethods inherited from interface ModifierReviewable
getSyntheticState, isFinal, isSyntheticMethods inherited from interface ModifierReviewable.ForParameterDescription
getParameterManifestation, getProvisioningStateMethods inherited from interface ModifierReviewable.OfMandatable
getMandate, isMandatedMethods inherited from interface NamedElement
getActualNameMethods inherited from interface NamedElement.WithRuntimeName
getInternalNameMethods inherited from interface ParameterDescription
getOffset, getTypeMethods inherited from interface ParameterDescription.InDefinedShape
getDeclaringMethod
-
Field Details
-
MALFORMED_PARAMETERS_EXCEPTION
The name of thejava.lang.reflect.MalformedParametersException. Due to compiler bugs, parameter declarations might not always be legal, and by checking for this exception, one can trigger a fallback behaviour.- See Also:
-
PARAMETER
A dispatcher for reading properties fromjava.lang.reflect.Parameterinstances. -
executable
Thejava.lang.reflect.Executablefor which the parameter types are described. -
index
protected final int indexThe parameter's index. -
parameterAnnotationSource
protected final ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSourceThe parameter annotation source to query.
-
-
Constructor Details
-
ForLoadedParameter
protected ForLoadedParameter(T executable, int index, ParameterDescription.ForLoadedParameter.ParameterAnnotationSource parameterAnnotationSource) Creates a new description for a loaded parameter.- Parameters:
executable- Thejava.lang.reflect.Executablefor which the parameter types are described.index- The parameter's index.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.
-
getName
Returns the binary name of this byte code element. If no well-defined internal name is known for this element, the actual name is returned.- Specified by:
getNamein interfaceNamedElement.WithRuntimeName- Overrides:
getNamein classParameterDescription.AbstractBase- Returns:
- The binary ame of this byte code element as visible from within a running Java application.
-
getIndex
public int getIndex()Returns this parameter's index.- Returns:
- The index of this parameter.
-
isNamed
public boolean isNamed()Returnstrueif this element has an explicit name.- Returns:
trueif this element has an explicit name.
-
getModifiers
public int getModifiers()Returns the modifier that is described by this object.- Specified by:
getModifiersin interfaceModifierReviewable- Overrides:
getModifiersin classParameterDescription.AbstractBase- Returns:
- The modifier that is described by this object.
-
hasModifiers
public boolean hasModifiers()Checks if this parameter has an explicit modifier. A parameter without a modifier is simply treated as if it had a modifier of zero.- Returns:
trueif this parameter defines explicit modifiers.
-