Package net.bytebuddy.description.method
Class ParameterDescription.TypeSubstituting
- java.lang.Object
-
- net.bytebuddy.description.ModifierReviewable.AbstractBase
-
- net.bytebuddy.description.method.ParameterDescription.AbstractBase
-
- net.bytebuddy.description.method.ParameterDescription.TypeSubstituting
-
- All Implemented Interfaces:
AnnotationSource
,ByteCodeElement.TypeDependant<ParameterDescription.InDefinedShape,ParameterDescription.Token>
,ParameterDescription
,ParameterDescription.InGenericShape
,ModifierReviewable
,ModifierReviewable.ForFieldDescription
,ModifierReviewable.ForMethodDescription
,ModifierReviewable.ForParameterDescription
,ModifierReviewable.ForTypeDefinition
,ModifierReviewable.OfAbstraction
,ModifierReviewable.OfByteCodeElement
,ModifierReviewable.OfEnumeration
,NamedElement
,NamedElement.WithOptionalName
,NamedElement.WithRuntimeName
- Enclosing interface:
- ParameterDescription
public static class ParameterDescription.TypeSubstituting extends ParameterDescription.AbstractBase implements ParameterDescription.InGenericShape
A parameter description that represents a given parameter but with a substituted parameter type.
Note: The supplied visitor must assure to not substitute
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.annotation.AnnotationSource
AnnotationSource.Empty, AnnotationSource.Explicit
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.method.ParameterDescription
ParameterDescription.AbstractBase, ParameterDescription.ForLoadedParameter<T extends java.lang.reflect.AccessibleObject>, ParameterDescription.InDefinedShape, ParameterDescription.InGenericShape, ParameterDescription.Latent, ParameterDescription.Token, ParameterDescription.TypeSubstituting
-
-
Field Summary
Fields Modifier and Type Field Description private MethodDescription.InGenericShape
declaringMethod
The method that declares this type-substituted parameter.private ParameterDescription
parameterDescription
The represented parameter.private TypeDescription.Generic.Visitor<? extends TypeDescription.Generic>
visitor
A visitor that is applied to the parameter type.-
Fields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASK
-
Fields inherited from interface net.bytebuddy.description.NamedElement
EMPTY_NAME, NO_NAME
-
Fields inherited from interface net.bytebuddy.description.method.ParameterDescription
NAME_PREFIX
-
-
Constructor Summary
Constructors Constructor Description TypeSubstituting(MethodDescription.InGenericShape declaringMethod, ParameterDescription parameterDescription, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Creates a new type substituting parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterDescription.InDefinedShape
asDefined()
Returns this type dependant in its defined shape, i.e.AnnotationList
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.MethodDescription.InGenericShape
getDeclaringMethod()
Returns the method that declares this parameter.int
getIndex()
Returns this parameter's index.int
getModifiers()
Returns the modifier that is described by this object.java.lang.String
getName()
Returns the internalName of this byte code element.int
getOffset()
Returns the offset to the parameter value within the local method variable.TypeDescription.Generic
getType()
Returns the type of this parameter.boolean
hasModifiers()
Checks if this parameter has an explicit modifier.boolean
isNamed()
Returnstrue
if this element has an explicit name.-
Methods inherited from class net.bytebuddy.description.method.ParameterDescription.AbstractBase
asToken, equals, getActualName, getInternalName, hashCode, toString
-
Methods inherited from class net.bytebuddy.description.ModifierReviewable.AbstractBase
getEnumerationState, getFieldManifestation, getFieldPersistence, getMethodManifestation, getMethodStrictness, getOwnership, getParameterManifestation, getProvisioningState, getSynchronizationState, getSyntheticState, getTypeManifestation, getVisibility, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatile
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.description.ByteCodeElement.TypeDependant
asToken
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable
getSyntheticState, isFinal, isSynthetic
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.ForParameterDescription
getParameterManifestation, getProvisioningState, isMandated
-
Methods inherited from interface net.bytebuddy.description.NamedElement
getActualName
-
Methods inherited from interface net.bytebuddy.description.NamedElement.WithRuntimeName
getInternalName
-
-
-
-
Field Detail
-
declaringMethod
private final MethodDescription.InGenericShape declaringMethod
The method that declares this type-substituted parameter.
-
parameterDescription
private final ParameterDescription parameterDescription
The represented parameter.
-
visitor
private final TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor
A visitor that is applied to the parameter type.
-
-
Constructor Detail
-
TypeSubstituting
public TypeSubstituting(MethodDescription.InGenericShape declaringMethod, ParameterDescription parameterDescription, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Creates a new type substituting parameter.- Parameters:
declaringMethod
- The method that declares this type-substituted parameter.parameterDescription
- The represented parameter.visitor
- A visitor that is applied to the parameter type.
-
-
Method Detail
-
getType
public TypeDescription.Generic getType()
Returns the type of this parameter.- Specified by:
getType
in interfaceParameterDescription
- Returns:
- The type of this parameter.
-
getDeclaringMethod
public MethodDescription.InGenericShape getDeclaringMethod()
Returns the method that declares this parameter.- Specified by:
getDeclaringMethod
in interfaceParameterDescription
- Specified by:
getDeclaringMethod
in interfaceParameterDescription.InGenericShape
- Returns:
- The method that declares this parameter.
-
getIndex
public int getIndex()
Returns this parameter's index.- Specified by:
getIndex
in interfaceParameterDescription
- Returns:
- The index of this parameter.
-
isNamed
public boolean isNamed()
Returnstrue
if this element has an explicit name.- Specified by:
isNamed
in interfaceNamedElement.WithOptionalName
- Returns:
true
if this element has an explicit name.
-
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.- Specified by:
hasModifiers
in interfaceParameterDescription
- Returns:
true
if this parameter defines explicit modifiers.
-
getOffset
public int getOffset()
Returns the offset to the parameter value within the local method variable.- Specified by:
getOffset
in interfaceParameterDescription
- Overrides:
getOffset
in classParameterDescription.AbstractBase
- Returns:
- The offset of this parameter's value.
-
getName
public java.lang.String getName()
Returns the internalName of this byte code element.- Specified by:
getName
in interfaceNamedElement.WithRuntimeName
- Overrides:
getName
in classParameterDescription.AbstractBase
- Returns:
- The internalName of this byte code element as visible from within a running Java application.
-
getModifiers
public int getModifiers()
Returns the modifier that is described by this object.- Specified by:
getModifiers
in interfaceModifierReviewable
- Overrides:
getModifiers
in classParameterDescription.AbstractBase
- Returns:
- The modifier that is described by this object.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.- Specified by:
getDeclaredAnnotations
in interfaceAnnotationSource
- Returns:
- A list of declared annotations.
-
asDefined
public ParameterDescription.InDefinedShape asDefined()
Returns this type dependant in its defined shape, i.e. the form it is declared in and without its type variable's resolved.- Specified by:
asDefined
in interfaceByteCodeElement.TypeDependant<ParameterDescription.InDefinedShape,ParameterDescription.Token>
- Returns:
- This type dependant in its defined shape.
-
-