Interface CtExecutableReference<T>

    • Method Detail

      • isConstructor

        boolean isConstructor()
        Tells if this is a reference to a constructor.
      • getActualMethod

        Method getActualMethod()
        Gets the runtime method that corresponds to an executable reference if any.
        Returns:
        the method (null if not found)
      • getActualConstructor

        Constructor<?> getActualConstructor()
        Gets the runtime constructor that corresponds to an executable reference if any.
        Returns:
        the constructor (null if not found)
      • getExecutableDeclaration

        CtExecutable<T> getExecutableDeclaration()
        Returns a subtype CtExecutable that corresponds to the reference even if its declaring type isn't in the Spoon source path (in this case, the Spoon elements are built with runtime reflection).
        Returns:
        the executable declaration that corresponds to the reference.
      • getDeclaringType

        CtTypeReference<?> getDeclaringType()
        Gets the reference to the type that declares this executable.
      • getType

        CtTypeReference<T> getType()
        For methods, gets the return type of the executable (may be null in noclasspath mode). For constructors, gets the constructor class (which is also the return type of the contructor calls).
      • isOverriding

        boolean isOverriding​(CtExecutableReference<?> executable)
        Returns true if this executable overrides the given executable.
      • getOverridingExecutable

        CtExecutableReference<?> getOverridingExecutable()
        Returns the method overridden by this one, if exists (null otherwise). The returned method is searched in the superclass hierarchy (and not in the super-interfaces). The returned method can be an abstract method from an abstract class, a super implementation, or even a method from Object.
      • getOverridingExecutable

        <S extends TCtExecutableReference<S> getOverridingExecutable​(CtTypeReference<?> subType)
        Gets an overriding executable for this executable from a given subtype, if exists.
        Type Parameters:
        S - subtype of T
        Parameters:
        subType - starting bottom type to find an overriding executable (subtypes are not tested)
        Returns:
        the first found (most concrete) executable that overrides this executable (null if none found)
      • isStatic

        boolean isStatic()
        Tells if the referenced executable is static.
      • setStatic

        <C extends CtExecutableReference<T>> C setStatic​(boolean b)
        Sets this executable reference to be static or not.
      • isFinal

        boolean isFinal()
        Tells if the referenced executable is final.