Packages

c

org.opalj.br

JVMMethod

sealed abstract class JVMMethod extends ClassMember with Ordered[JVMMethod] with InstructionsContainer

Represents a single method.

Method objects are constructed using the companion object's factory methods.

Source
Method.scala
Note

Methods, which are directly created, have no link to "their defining" ClassFile. This link is implicitly established when a method is added to a ClassFile. This operation also updates the method object. Hence, an empty method/constructor which is identical across multiple classes can be reused.

,

Equality of methods is – by purpose – reference based.

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

Abstract Value Members

  1. abstract def 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
    JVMMethodConcreteSourceElement
  2. abstract def 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
    JVMMethodCommonAttributes
  3. abstract def body: Option[Code]

    The body of the method if any.

  4. abstract def descriptor: MethodDescriptor

    This method's descriptor.

  5. abstract def 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
    JVMMethodClassMember

Concrete 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. def actualArgumentsCount: Int

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

  9. def annotationDefault: Option[ElementValue]

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

  10. 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
  11. def asClassFile: ClassFile
    Definition Classes
    SourceElement
  12. def asField: Field
    Definition Classes
    SourceElement
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def asMethod: Method
    Definition Classes
    SourceElement
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  16. def compare(otherName: String, otherDescriptor: MethodDescriptor): Int
  17. 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
  18. 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
  19. def compareTo(that: JVMMethod): Int
    Definition Classes
    Ordered → Comparable
  20. 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.

  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  23. def exceptionTable: Option[ExceptionTable]
  24. final def foreachTypeAnnotation[U](f: (TypeAnnotation) ⇒ U): Unit
    Definition Classes
    CommonAttributes
  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  26. final def hasDefaultVisibility: Boolean
    Definition Classes
    ClassMember
  27. def hasFlags(accessFlags: Int): Boolean
    Definition Classes
    ConcreteSourceElement
  28. 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.

    Note

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

  29. 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.)

  30. 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.

  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  32. final def instructionsOption: Option[Array[Instruction]]
    Definition Classes
    JVMMethodInstructionsContainer
  33. final def isAbstract: Boolean
  34. final def isBridge: Boolean
  35. def isClass: Boolean
    Definition Classes
    SourceElement
  36. final def isConstructor: Boolean
  37. 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
  38. def isField: Boolean
    Definition Classes
    SourceElement
  39. final def isFinal: Boolean
    Definition Classes
    ClassMember
  40. final def isInitializer: Boolean
  41. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  42. 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.

  43. def isMethod: Boolean
    Definition Classes
    SourceElement
  44. final def isNative: Boolean
  45. final def isNativeAndVarargs: Boolean
  46. final def isNotAbstract: Boolean
  47. final def isNotFinal: Boolean
    Definition Classes
    ClassMember
  48. final def isNotStatic: Boolean
    Definition Classes
    ClassMember
  49. final def isPackagePrivate: Boolean
    Definition Classes
    ClassMember
  50. final def isPrivate: Boolean
    Definition Classes
    ClassMember
  51. final def isProtected: Boolean
    Definition Classes
    ClassMember
  52. final def isPublic: Boolean
    Definition Classes
    ClassMember
  53. final def isStatic: Boolean
    Definition Classes
    ClassMember
  54. final def isStaticInitializer: Boolean
  55. final def isStrict: Boolean
  56. final def isSynchronized: Boolean
  57. 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
  58. 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.

  59. final def isVarargs: Boolean
  60. def isVirtual: Boolean
    Definition Classes
    SourceElement
  61. 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.

  62. 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!

  63. def methodParameters: Option[MethodParameterTable]

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

  64. def methodTypeSignature: Option[MethodTypeSignature]

    Each method optionally defines a method type signature.

  65. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  66. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  67. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  68. def parameterAnnotations: Iterator[Annotations]
  69. def parameterTypes: FieldTypes
  70. 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.

  71. def returnType: Type
  72. def runtimeInvisibleAnnotations: Annotations
  73. def runtimeInvisibleParameterAnnotations: ParameterAnnotations
  74. def runtimeInvisibleTypeAnnotations: TypeAnnotations
    Definition Classes
    CommonAttributes
  75. def runtimeVisibleAnnotations: Annotations
  76. def runtimeVisibleParameterAnnotations: ParameterAnnotations
  77. def runtimeVisibleTypeAnnotations: TypeAnnotations
    Definition Classes
    CommonAttributes
  78. def signature: MethodSignature
  79. def signatureToJava(withVisibility: Boolean = true): String
  80. 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!

  81. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  82. def toString(): String
    Definition Classes
    JVMMethod → AnyRef → Any
  83. def visibilityModifier: Option[VisibilityModifier]
    Definition Classes
    ConcreteSourceElement
  84. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  86. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

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

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