Package io.github.classgraph
Class MethodParameterInfo
- java.lang.Object
-
- io.github.classgraph.MethodParameterInfo
-
public class MethodParameterInfo extends java.lang.Object
Information on the parameters of a method.- Author:
- lukehutch
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
AnnotationInfoList
getAnnotationInfo()
Method parameter annotation info (or null if no annotations).AnnotationInfo
getAnnotationInfo(java.lang.String annotationName)
Get a the named non-Repeatable
annotation on this method, or null if the method parameter does not have the named annotation.AnnotationInfoList
getAnnotationInfoRepeatable(java.lang.String annotationName)
Get a the namedRepeatable
annotation on this method, or the empty list if the method parameter does not have the named annotation.MethodInfo
getMethodInfo()
Get theMethodInfo
for the defining method.int
getModifiers()
Method parameter modifiers.java.lang.String
getModifiersStr()
Get the method parameter modifiers as a String, e.g.java.lang.String
getName()
Method parameter name.TypeSignature
getTypeDescriptor()
Method parameter type descriptor.TypeSignature
getTypeSignature()
Method parameter type signature, possibly including generic type information (or null if no type signature information available for this parameter).TypeSignature
getTypeSignatureOrTypeDescriptor()
Method parameter type signature, or if not available, method type descriptor.boolean
hasAnnotation(java.lang.String annotationName)
Check whether this method parameter has the named annotation.int
hashCode()
protected void
setScanResult(ScanResult scanResult)
Sets the scan result.java.lang.String
toString()
-
-
-
Method Detail
-
getMethodInfo
public MethodInfo getMethodInfo()
Get theMethodInfo
for the defining method.- Returns:
- The
MethodInfo
for the defining method.
-
getName
public java.lang.String getName()
Method parameter name. May be null, for unnamed parameters (e.g. synthetic parameters), or if compiled for JDK version lower than 8, or if compiled for JDK version 8+ but without the commandline switch `-parameters`.- Returns:
- The method parameter name.
-
getModifiers
public int getModifiers()
Method parameter modifiers. May be zero, if no modifier bits set, or if compiled for JDK version lower than 8, or if compiled for JDK version 8+ but without the commandline switch `-parameters`.- Returns:
- The method parameter modifiers.
-
getModifiersStr
public java.lang.String getModifiersStr()
Get the method parameter modifiers as a String, e.g. "final". For the modifier bits, callgetModifiers()
.- Returns:
- The modifiers for the method parameter, as a String.
-
getTypeSignature
public TypeSignature getTypeSignature()
Method parameter type signature, possibly including generic type information (or null if no type signature information available for this parameter).- Returns:
- The method type signature, if available, else null.
-
getTypeDescriptor
public TypeSignature getTypeDescriptor()
Method parameter type descriptor.- Returns:
- The method type descriptor.
-
getTypeSignatureOrTypeDescriptor
public TypeSignature getTypeSignatureOrTypeDescriptor()
Method parameter type signature, or if not available, method type descriptor.- Returns:
- The method type signature, if present, otherwise the method type descriptor.
-
getAnnotationInfo
public AnnotationInfoList getAnnotationInfo()
Method parameter annotation info (or null if no annotations).- Returns:
AnnotationInfo
for any annotations on this method parameter.
-
getAnnotationInfo
public AnnotationInfo getAnnotationInfo(java.lang.String annotationName)
Get a the named non-Repeatable
annotation on this method, or null if the method parameter does not have the named annotation. (UsegetAnnotationInfoRepeatable(String)
forRepeatable
annotations.)- Parameters:
annotationName
- The annotation name.- Returns:
- An
AnnotationInfo
object representing the named annotation on this method parameter, or null if the method parameter does not have the named annotation.
-
getAnnotationInfoRepeatable
public AnnotationInfoList getAnnotationInfoRepeatable(java.lang.String annotationName)
Get a the namedRepeatable
annotation on this method, or the empty list if the method parameter does not have the named annotation.- Parameters:
annotationName
- The annotation name.- Returns:
- An
AnnotationInfoList
containing all instances of the named annotation on this method parameter, or the empty list if the method parameter does not have the named annotation.
-
hasAnnotation
public boolean hasAnnotation(java.lang.String annotationName)
Check whether this method parameter has the named annotation.- Parameters:
annotationName
- The name of an annotation.- Returns:
- true if this method parameter has the named annotation.
-
setScanResult
protected void setScanResult(ScanResult scanResult)
Sets the scan result.- Parameters:
scanResult
- the new scan result
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-