Class ASTFormalParameter

    • Method Detail

      • isVarargs

        public boolean isVarargs()
        Returns true if this node is a varargs parameter.
      • isExplicitReceiverParameter

        public boolean isExplicitReceiverParameter()
        Returns true if this node is the explicit receiver parameter, e.g. in
         class Foo {
           abstract void foo(@Bar Foo this);
         }
         
      • isTypeInferred

        public boolean isTypeInferred()
        If true, this formal parameter represents one without explit types. This can appear as part of a lambda expression with java11 using "var".
        See Also:
        ASTVariableDeclaratorId.isTypeInferred()
      • getVariableDeclaratorId

        public ASTVariableDeclaratorId getVariableDeclaratorId()
        Returns the declarator ID of this formal parameter.
      • isArray

        @Deprecated
        public boolean isArray()
        Deprecated.
        Returns true if this formal parameter is of an array type. This includes varargs parameters.
        Specified by:
        isArray in interface Dimensionable
      • getTypeNode

        public ASTType getTypeNode()
        Returns the type node of this formal parameter. The type of that node is not necessarily the type of the parameter itself, see ASTVariableDeclaratorId.getType().

        In particular, the type of the returned node doesn't take into account whether this formal parameter is varargs or not.

      • getType

        public Class<?> getType()
        Returns the type of this formal parameter. That type is exactly that of the variable declarator id, which means that the declarator id's type takes into account whether this parameter is varargs or not.
        Specified by:
        getType in interface TypeNode
        Overrides:
        getType in class AbstractJavaAccessTypeNode
        Returns:
        The Java Class, may return null.
      • getAnnotation

        public ASTAnnotation getAnnotation​(String annotQualifiedName)
        Description copied from interface: Annotatable
        Get specific annotaion on this node.
        Specified by:
        getAnnotation in interface Annotatable
        Parameters:
        annotQualifiedName - qulified name of the annotation.
        Returns:
        ASTAnnotaion node if the annotation is present on this node, else null
      • isAnnotationPresent

        public boolean isAnnotationPresent​(String annotQualifiedName)
        Description copied from interface: Annotatable
        Checks whether the annotation is present on this node.
        Specified by:
        isAnnotationPresent in interface Annotatable
        Parameters:
        annotQualifiedName - qulified name of the annotation.
        Returns:
        true if the annotation is present on this node, else false
      • isAnyAnnotationPresent

        public boolean isAnyAnnotationPresent​(Collection<String> annotQualifiedNames)
        Description copied from interface: Annotatable
        Checks whether any annotation is present on this node.
        Specified by:
        isAnyAnnotationPresent in interface Annotatable
        Parameters:
        annotQualifiedNames - collection that cotains qulified name of annotations.
        Returns:
        true if any annotation is present on this node, else false