Packages

final class Method extends JVMMethod

A method belonging to a class file. Method objects are created by creating a class file using MethodTemplates.

Source
Method.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Method
  2. JVMMethod
  3. InstructionsContainer
  4. Ordered
  5. Comparable
  6. ClassMember
  7. ConcreteSourceElement
  8. SourceElement
  9. CommonSourceElementAttributes
  10. CommonAttributes
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def <(that: JVMMethod): Boolean
    Definition Classes
    Ordered
  4. def <=(that: JVMMethod): Boolean
    Definition Classes
    Ordered
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def >(that: JVMMethod): Boolean
    Definition Classes
    Ordered
  7. def >=(that: JVMMethod): Boolean
    Definition Classes
    Ordered
  8. val accessFlags: Int

    The access flags of this method.

    The access flags of this method. Though it is possible to directly work with the accessFlags field, it may be more convenient to use the respective methods (isNative, isAbstract, ...) to query the access flags.

    Definition Classes
    MethodJVMMethodConcreteSourceElement
  9. def actualArgumentsCount: Int

    The number of explicit and implicit parameters of this method – that is, including this in case of a non-static method.

    The number of explicit and implicit parameters of this method – that is, including this in case of a non-static method.

    Definition Classes
    JVMMethod
  10. def annotationDefault: Option[ElementValue]

    If this method represents a method of an annotation that defines a default value then this value is returned.

    If this method represents a method of an annotation that defines a default value then this value is returned.

    Definition Classes
    JVMMethod
  11. def annotations: Annotations

    The list of all annotations.

    The list of all annotations. In general, if a specific annotation is searched for the method runtimeVisibleAnnotations or runtimeInvisibleAnnotations should be used.

    Definition Classes
    CommonSourceElementAttributes
  12. def asClassFile: ClassFile
    Definition Classes
    SourceElement
  13. def asField: Field
    Definition Classes
    SourceElement
  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. def asMethod: Method.this.type
    Definition Classes
    MethodSourceElement
  16. def asVirtualMethod(declaringClassType: ObjectType): VirtualMethod

    This method as a virtual method belonging to the given declaring class type.

  17. def asVirtualMethod: VirtualMethod

    returns

    This method as a VirtualMethod.

  18. val attributes: Attributes

    This method's defined attributes.

    This method's defined attributes. (Which attributes are available generally depends on the configuration of the class file reader. However, the Code_Attribute is – if it was loaded – always directly accessible by means of the body attribute.)

    Definition Classes
    MethodJVMMethodCommonAttributes
  19. val body: Option[Code]

    The body of the method if any.

    The body of the method if any.

    Definition Classes
    MethodJVMMethod
  20. def classFile: ClassFile

    This method's class file.

  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  22. def compare(otherName: String, otherDescriptor: MethodDescriptor): Int
    Definition Classes
    JVMMethod
  23. def compare(other: JVMMethod): Int

    Defines an absolute order on Method instances based on their method signatures.

    Defines an absolute order on Method instances based on their method signatures.

    The order is defined by lexicographically comparing the names of the methods and – in case that the names of both methods are identical – by comparing their method descriptors.

    Definition Classes
    JVMMethod → Ordered
  24. def compareAttributes(other: Attributes, config: SimilarityTestConfiguration): Option[AnyRef]

    Compares this element's attributes with the given one.

    Compares this element's attributes with the given one.

    returns

    None, if both attribute lists are similar; Some(<description of the difference>) otherwise.

    Attributes
    protected[this]
    Definition Classes
    CommonAttributes
  25. def compareTo(that: JVMMethod): Int
    Definition Classes
    Ordered → Comparable
  26. def copy(accessFlags: Int = this.accessFlags, name: String = this.name, descriptor: MethodDescriptor = this.descriptor, body: Option[Code] = this.body, attributes: Attributes = this.attributes): MethodTemplate

    Creates a copy of this method object which is not associated with any class file.

    Creates a copy of this method object which is not associated with any class file.

    Definition Classes
    JVMMethod
  27. val descriptor: MethodDescriptor

    This method's descriptor.

    This method's descriptor.

    Definition Classes
    MethodJVMMethod
  28. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  30. def exceptionTable: Option[ExceptionTable]
    Definition Classes
    JVMMethod
  31. final def foreachTypeAnnotation[U](f: (TypeAnnotation) => U): Unit
    Definition Classes
    CommonAttributes
  32. def fullyQualifiedSignature: String

    The fully qualified signature of this method.

  33. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  34. final def hasDefaultVisibility: Boolean
    Definition Classes
    ClassMember
  35. def hasFlags(accessFlags: Int): Boolean
    Definition Classes
    ConcreteSourceElement
  36. def hasSignature(name: String, descriptor: MethodDescriptor): Boolean

    Returns true if this method has the given name and descriptor.

    Returns true if this method has the given name and descriptor.

    Definition Classes
    JVMMethod
    Note

    When matching the descriptor the return type is also taken into consideration.

  37. def hasSignature(other: Method, ignoreReturnType: Boolean = false): Boolean

    Returns true if this method and the given method have the same signature.

    Returns true if this method and the given method have the same signature.

    ignoreReturnType

    If false (default), then the return type is taken into consideration. This models the behavior of the JVM w.r.t. method dispatch. However, if you want to determine whether this method potentially overrides the given one, you may want to specify that you want to ignore the return type. (The Java compiler generates the appropriate methods.)

    Definition Classes
    JVMMethod
  38. def hasSignature(name: String, descriptor: MethodDescriptor, ignoreReturnType: Boolean): Boolean

    Returns true if this method has the given name and descriptor.

    Returns true if this method has the given name and descriptor.

    ignoreReturnType

    If false, then the return type is taken into consideration; this models the behavior of the JVM w.r.t. method dispatch.

    Definition Classes
    JVMMethod
  39. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  40. final def instructionsOption: Option[Array[Instruction]]
    Definition Classes
    JVMMethodInstructionsContainer
  41. def invalidBytecode(message: Option[String]): Method

    Creates a method object based on this method where the body is replaced by the code returned by Code.invalidBytecode.

    Creates a method object based on this method where the body is replaced by the code returned by Code.invalidBytecode. This method is NOT replaced in its declaring class file.

    message

    A short descriptive method that states why the body was replaced.

  42. final def isAbstract: Boolean
    Definition Classes
    JVMMethod
  43. def isAccessibleBy(objectType: ObjectType, nests: Map[ObjectType, ObjectType])(implicit classHierarchy: ClassHierarchy): Boolean
  44. final def isBridge: Boolean
    Definition Classes
    JVMMethod
  45. def isClass: Boolean
    Definition Classes
    SourceElement
  46. final def isConstructor: Boolean
    Definition Classes
    JVMMethod
  47. def isDeprecated: Boolean

    Returns true if this (field, method, class) declaration is declared as deprecated.

    Returns true if this (field, method, class) declaration is declared as deprecated.

    Note

    The deprecated attribute is always set by the Java compiler when either the deprecated annotation or the JavaDoc tag is used.

    Definition Classes
    CommonSourceElementAttributes
  48. def isField: Boolean
    Definition Classes
    SourceElement
  49. final def isFinal: Boolean
    Definition Classes
    ClassMember
  50. final def isInitializer: Boolean
    Definition Classes
    JVMMethod
  51. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  52. def isMandatedParameter(parameterIndex: Int): Answer

    Returns Yes if the parameter with the given index is mandated; No if not and Unknown if the information is not available.

    Returns Yes if the parameter with the given index is mandated; No if not and Unknown if the information is not available. The indexes correspond to those used by the MethodDescriptor.

    Definition Classes
    JVMMethod
  53. def isMethod: Boolean
    Definition Classes
    MethodSourceElement
  54. final def isNative: Boolean
    Definition Classes
    JVMMethod
  55. final def isNativeAndVarargs: Boolean
    Definition Classes
    JVMMethod
  56. final def isNotAbstract: Boolean
    Definition Classes
    JVMMethod
  57. final def isNotFinal: Boolean
    Definition Classes
    ClassMember
  58. final def isNotStatic: Boolean
    Definition Classes
    ClassMember
  59. final def isPackagePrivate: Boolean
    Definition Classes
    ClassMember
  60. final def isPrivate: Boolean
    Definition Classes
    ClassMember
  61. final def isProtected: Boolean
    Definition Classes
    ClassMember
  62. final def isPublic: Boolean
    Definition Classes
    ClassMember
  63. final def isStatic: Boolean
    Definition Classes
    ClassMember
  64. final def isStaticInitializer: Boolean
    Definition Classes
    JVMMethod
  65. def isStrict: Boolean

    returns

    wether this class is defined as strict. Starting from Java 17, this is true by default. Strict evaluation of float expressions was also required in Java 1.0 and 1.1.

    Definition Classes
    MethodJVMMethod
  66. final def isSynchronized: Boolean
    Definition Classes
    JVMMethod
  67. final def isSynthetic: Boolean

    True if the Synthetic access flag or attribute is used.

    True if the Synthetic access flag or attribute is used.

    Definition Classes
    ClassMemberCommonSourceElementAttributes
  68. def isSyntheticParameter(parameterIndex: Int): Answer

    Returns Yes if the parameter with the given index is synthetic; No if not and Unknown if the information is not available.

    Returns Yes if the parameter with the given index is synthetic; No if not and Unknown if the information is not available. The indexes correspond to those used by the MethodDescriptor.

    Definition Classes
    JVMMethod
  69. final def isVarargs: Boolean
    Definition Classes
    JVMMethod
  70. def isVirtual: Boolean
    Definition Classes
    SourceElement
  71. final def isVirtualCallTarget: Boolean

    Returns true if this method is a potential target of a virtual call by means of an invokevirtual or invokeinterface instruction; i.e., if the method is not an initializer, is not abstract, is not private and is not static.

    Returns true if this method is a potential target of a virtual call by means of an invokevirtual or invokeinterface instruction; i.e., if the method is not an initializer, is not abstract, is not private and is not static.

    Definition Classes
    JVMMethod
  72. final def isVirtualMethodDeclaration: Boolean

    Returns true if this method declares a virtual method.

    Returns true if this method declares a virtual method. This method may be abstract!

    Definition Classes
    JVMMethod
  73. def methodParameters: Option[MethodParameterTable]

    If this method has extended method parameter information, the MethodParameterTable is returned.

    If this method has extended method parameter information, the MethodParameterTable is returned.

    Definition Classes
    JVMMethod
  74. def methodTypeSignature: Option[MethodTypeSignature]

    Each method optionally defines a method type signature.

    Each method optionally defines a method type signature.

    Definition Classes
    JVMMethod
  75. val name: String

    The name of the method.

    The name of the method. The name is interned (see String.intern() for details) to enable reference comparisons.

    Definition Classes
    MethodJVMMethodClassMember
  76. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  77. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  78. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  79. def parameterAnnotations: Iterator[Annotations]
    Definition Classes
    JVMMethod
  80. def parameterTypes: FieldTypes
    Definition Classes
    JVMMethod
  81. def requiredRegisters: Int

    The number of registers required to store this method's parameters ( including the self reference if necessary).

    The number of registers required to store this method's parameters ( including the self reference if necessary).

    Basically, MethodDescriptor.requiredRegisters adapted by the required parameter for this in case of an instance method.

    Definition Classes
    JVMMethod
  82. def returnType: Type
    Definition Classes
    JVMMethod
  83. def runtimeInvisibleAnnotations: Annotations
  84. def runtimeInvisibleParameterAnnotations: ParameterAnnotations
    Definition Classes
    JVMMethod
  85. def runtimeInvisibleTypeAnnotations: TypeAnnotations
    Definition Classes
    CommonAttributes
  86. def runtimeVisibleAnnotations: Annotations
  87. def runtimeVisibleParameterAnnotations: ParameterAnnotations
    Definition Classes
    JVMMethod
  88. def runtimeVisibleTypeAnnotations: TypeAnnotations
    Definition Classes
    CommonAttributes
  89. def signature: MethodSignature
    Definition Classes
    JVMMethod
  90. def signatureToJava(withVisibility: Boolean = true): String
    Definition Classes
    JVMMethod
  91. def similar(other: JVMMethod, config: SimilarityTestConfiguration): Boolean

    Compares this method with the given one for structural equality.

    Compares this method with the given one for structural equality. The declaring class file is ignored.

    Two methods are structurally equal if they have the same names, flags and descriptor. The bodies and attributes are recursively checked for structural equality. In case of the attributes, the order doesn't matter!

    Definition Classes
    JVMMethod
  92. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  93. def toJava(methodInfo: String): String

    A Java-like representation of the signature of this method; "the body" will contain the given methodInfo data.

  94. def toJava: String
  95. def toString(): String
    Definition Classes
    MethodJVMMethod → AnyRef → Any
  96. def visibilityModifier: Option[VisibilityModifier]
    Definition Classes
    ConcreteSourceElement
  97. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  98. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  99. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from JVMMethod

Inherited from InstructionsContainer

Inherited from Ordered[JVMMethod]

Inherited from Comparable[JVMMethod]

Inherited from ClassMember

Inherited from ConcreteSourceElement

Inherited from SourceElement

Inherited from CommonAttributes

Inherited from AnyRef

Inherited from Any

Ungrouped