Class ASTCatchParameter

    • Method Detail

      • acceptVisitor

        protected <P,​R> R acceptVisitor​(JavaVisitor<? super P,​? extends R> visitor,
                                              P data)
      • isMulticatch

        public boolean isMulticatch()
        Returns true if this is a multi-catch parameter, that is, it catches several unrelated exception types at the same time. For example:
        catch (IllegalStateException | IllegalArgumentException e) {}
      • getName

        public String getName()
        Returns the name of this parameter.
      • getTypeNode

        public ASTType getTypeNode()
        Returns the type node of this catch parameter. May be a UnionType.
      • getAllExceptionTypes

        public NodeStream<ASTClassType> getAllExceptionTypes()
        Returns a stream of all declared exception types (expanding a union type if present).

        Note that this is the only reliable way to inspect multi-catch clauses, as the type mirror of a ASTUnionType is not itself a JIntersectionType, but the LUB of the components. Since exception types cannot be interfaces, the LUB always erases to a single class supertype (eg RuntimeException).

      • isFinal

        public boolean isFinal()
      • acceptVisitor

        public final <P,​R> R acceptVisitor​(AstVisitor<? super P,​? extends R> visitor,
                                                 P data)
        Specified by:
        acceptVisitor in interface Node
      • addChild

        protected void addChild​(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child,
                                int index)
        Overrides:
        addChild in class AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,​JavaNode>
      • insertChild

        protected void insertChild​(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child,
                                   int index)
        Overrides:
        insertChild in class AbstractJjtreeNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,​JavaNode>
      • removeChildAtIndex

        protected void removeChildAtIndex​(int childIndex)
        Overrides:
        removeChildAtIndex in class AbstractNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,​JavaNode>
      • setChild

        protected void setChild​(net.sourceforge.pmd.lang.java.ast.AbstractJavaNode child,
                                int index)
        Overrides:
        setChild in class AbstractNode<net.sourceforge.pmd.lang.java.ast.AbstractJavaNode,​JavaNode>
      • getSymbolTable

        public @NonNull JSymbolTable getSymbolTable()
        Description copied from interface: JavaNode
        Returns the symbol table for the program point represented by this node.
        Specified by:
        getSymbolTable in interface JavaNode
      • getTypeSystem

        public TypeSystem getTypeSystem()
        Description copied from interface: JavaNode
        Returns the type system with which this node was created. This is the object responsible for representing types in the compilation unit.
        Specified by:
        getTypeSystem in interface JavaNode