Interface JExecutableSymbol

    • Method Detail

      • getFormalParameters

        List<JFormalParamSymbol> getFormalParameters()
        Returns the formal parameters this executable declares. These are only non-synthetic parameters. For example, a constructor for an inner non-static class will not reflect a parameter for the enclosing instance.
      • isDefaultMethod

        default boolean isDefaultMethod()
      • isVarargs

        boolean isVarargs()
        Returns true if the last formal parameter is a varargs parameter.
      • getArity

        int getArity()
        Returns the number of formal parameters expected. This must be the length of getFormalParameters() but if it can be implemented without creating the formal parameters, it should.

        A varargs parameter counts as a single parameter.

      • getAnnotatedReceiverType

        @Nullable JTypeMirror getAnnotatedReceiverType​(Substitution subst)
        Return the receiver type with all type annotations, when viewed under the given substitution. Return null if this method has no receiver.
        Throws:
        IllegalArgumentException - If the argument is not the receiver type of this type.
      • hasReceiver

        default boolean hasReceiver()
        Return true if this method needs to be called on a receiver instance. This is not the case if the method is static, or a constructor of an outer or static class.
      • getPackageName

        default @NonNull String getPackageName()
        Description copied from interface: JAccessibleElementSymbol
        Returns the name of the package this element is declared in. This recurses into the enclosing elements if needed. If this is an array symbol, returns the package name of the element symbol. If this is a primitive type, returns "java.lang".

        This is consistent with Java 9's getPackageName().

        Specified by:
        getPackageName in interface JAccessibleElementSymbol
      • getFormalParameterTypes

        List<JTypeMirror> getFormalParameterTypes​(Substitution subst)
        Returns the types of the formal parameters, when viewed under the given substitution. The returned list has one item for each formal.
        See Also:
        getFormalParameters()
      • getThrownExceptionTypes

        List<JTypeMirror> getThrownExceptionTypes​(Substitution subst)
        Returns the types of the thrown exceptions, when viewed under the given substitution.