Package org.jboss.jandex
Class MethodParameterInfo
- java.lang.Object
-
- org.jboss.jandex.MethodParameterInfo
-
- All Implemented Interfaces:
AnnotationTarget
public final class MethodParameterInfo extends Object implements AnnotationTarget
Represents an individual Java method parameter that was annotated.Thread-Safety
This class is immutable and can be shared between threads without safe publication.- Author:
- Jason T. Greene
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.jandex.AnnotationTarget
AnnotationTarget.Kind
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassInfoasClass()Casts and returns this target as aClassInfoif it is of kindCLASSFieldInfoasField()Casts and returns this target as aFieldInfoif it is of kindFIELDMethodInfoasMethod()Casts and returns this target as aMethodInfoif it is of kindMETHODMethodParameterInfoasMethodParameter()Casts and returns this target as aMethodParameterInfoif it is of kindMETHOD_PARAMETERRecordComponentInfoasRecordComponent()Casts and returns this target as aRecordComponentInfoif it is of kindRECORD_COMPONENTTypeTargetasType()Casts and returns this target as aTypeTargetif it is of kindTYPEstatic MethodParameterInfocreate(MethodInfo method, short parameter)Constructs a new mock method parameter infobooleanequals(Object o)inthashCode()AnnotationTarget.Kindkind()Returns the kind of object this target represents.MethodInfomethod()Returns the method this parameter belongs to.Stringname()Returns the name of this parameter.shortposition()Returns the 0 based position of this parameter.StringtoString()Returns a string representation describing this method parameter
-
-
-
Method Detail
-
create
public static MethodParameterInfo create(MethodInfo method, short parameter)
Constructs a new mock method parameter info- Parameters:
method- the method containing this parameter.parameter- the zero based index of this parameter- Returns:
- the new mock parameter info
-
method
public final MethodInfo method()
Returns the method this parameter belongs to.- Returns:
- the declaring Java method
-
position
public final short position()
Returns the 0 based position of this parameter.- Returns:
- the position of this parameter
-
name
public final String name()
Returns the name of this parameter.- Returns:
- the name of this parameter.
-
toString
public String toString()
Returns a string representation describing this method parameter
-
asClass
public final ClassInfo asClass()
Description copied from interface:AnnotationTargetCasts and returns this target as aClassInfoif it is of kindCLASS- Specified by:
asClassin interfaceAnnotationTarget- Returns:
- this instance cast to a class
-
asField
public final FieldInfo asField()
Description copied from interface:AnnotationTargetCasts and returns this target as aFieldInfoif it is of kindFIELD- Specified by:
asFieldin interfaceAnnotationTarget- Returns:
- this instance cast to a field
-
asMethod
public final MethodInfo asMethod()
Description copied from interface:AnnotationTargetCasts and returns this target as aMethodInfoif it is of kindMETHOD- Specified by:
asMethodin interfaceAnnotationTarget- Returns:
- this instance cast to a method
-
asMethodParameter
public final MethodParameterInfo asMethodParameter()
Description copied from interface:AnnotationTargetCasts and returns this target as aMethodParameterInfoif it is of kindMETHOD_PARAMETER- Specified by:
asMethodParameterin interfaceAnnotationTarget- Returns:
- this instance cast to a method parameter
-
asType
public final TypeTarget asType()
Description copied from interface:AnnotationTargetCasts and returns this target as aTypeTargetif it is of kindTYPE- Specified by:
asTypein interfaceAnnotationTarget- Returns:
- this instance cast to a type target
-
asRecordComponent
public RecordComponentInfo asRecordComponent()
Description copied from interface:AnnotationTargetCasts and returns this target as aRecordComponentInfoif it is of kindRECORD_COMPONENT- Specified by:
asRecordComponentin interfaceAnnotationTarget- Returns:
- this instance cast to a record component
-
kind
public AnnotationTarget.Kind kind()
Description copied from interface:AnnotationTargetReturns the kind of object this target represents.- Specified by:
kindin interfaceAnnotationTarget- Returns:
- the target kind.
-
-