Uses of Interface
net.sourceforge.pmd.lang.java.ast.JavaNode
Packages that use JavaNode
Package
Description
Contains the classes and interfaces modelling the Java AST.
Contains the built-in rules bundled with the Java distribution.
The new symbol resolution framework
that inter-operates cleanly with type resolution.
Support for compile-time type resolution on the AST.
-
Uses of JavaNode in net.sourceforge.pmd.lang.java.ast
Classes in net.sourceforge.pmd.lang.java.ast with type parameters of type JavaNodeModifier and TypeClassDescriptionclassCommon supertype for nodes that act as a kind of list of other nodes.Subinterfaces of JavaNode in net.sourceforge.pmd.lang.java.astModifier and TypeInterfaceDescriptioninterfaceMarks nodes that can be annotated.interfaceAn expression that may be assigned by an assignment expression, or incremented or decremented.static interfaceAn assignable expression that has a name, and refers to a symbol.interfaceMarker interface for declarations that can occur in a type body, such as field or method declarations.interfaceGroups method and constructor declarations under a common type.interfaceRepresents an expression, in the most general sense.interfaceA lexical literal.interfaceA loop statement.interfaceRepresents the value of a member of an annotation.interfaceA pattern for pattern matching constructs likeInstanceOfExpressionor within aASTSwitchLabel).interfaceTags thoseexpressionsthat are categorised as primary by the JLS.interfaceRepresents a reference type, i.e. a class or interface type, or an array type.interfaceRepresents a code statement.interfaceA node that can appear as the right-hand-side of aSwitchArrowRule.interfaceA branch of aSwitchLike.interfaceCommon supertype for switch statements and switch expressions.interfaceMarker interface for nodes that can appear on the top-level of a file.interfaceRepresents a type reference.interfaceGroups class, enum, record, annotation and interface declarations under a common supertype.interfaceA method reference or lambda expression.interfaceGroups method and constructor call, together, as well as explicit constructor invocation statements, and enum constant declarations.interfaceA node that may own a javadoc comment.interfaceA node that uses another method or constructor.interfaceA node that owns a modifier list.interfaceNode that may be qualified by an expression, e.g. an instance method call or inner class constructor invocation.interfaceMarker interface for those nodes that can be the target of a return statement.interfaceA node that declares a corresponding symbol.interfaceA node that has a statically known type.interfaceA symbol declaration, whose symbol can declare type parameters.Classes in net.sourceforge.pmd.lang.java.ast that implement JavaNodeModifier and TypeClassDescriptionclassfinal classAn ambiguous name occurring in any context.final classRepresents an annotation.final classRepresents the list ofmember-value pairsin anannotation.final classfinal classThe declaration of an annotation type.final classAn anonymous class declaration.final classfinal classAn array access expression.final classAn array creation expression.final classRepresents array type dimensions.final classRepresents an array dimension initialized with an expression in an array allocation expression.final classAn array initializer.final classRepresents an array type.classRepresents an array dimension in an array type, or in an array allocation expression.final classRepresents anassertstatement.final classRepresents an assignment expression.final classA block of code.final classThe boolean literal, either "true" or "false".final classA break statement, that jumps to a named label (or exits the current loop).final classRepresents a type cast expression.final classA "catch" clause of a try statement.final classFormal parameter of a catch clause to represent the declared exception variable.final classRepresents a character literal.final classRepresents the body of a class or interface declaration.final classRepresents class and interface declarations.final classA class literal.final classRepresents a class or interface type, possibly parameterised with type arguments.final classThis defines a compact constructor for a RecordDeclaration (JDK 16 feature).final classThe root node of all Java ASTs.final classRepresents a conditional expression, aka ternary expression.final classA class instance creation expression.final classfinal classA continue statement, that jumps to the next iteration of an enclosing loop.final classRepresents thedefaultclause of an annotation method.final classRepresents ado ... whilestatement.final classAn empty declaration (useless).final classAn empty statement (useless).final classBody of an enum declaration.final classRepresents an enum constant declaration within an enum type declaration.final classRepresents an enum declaration.final classAn explicit constructor invocation, occurring at the start of a constructor declaration.final classA statement that contains an expression.final classRepresents theextendsclause of a class or interface declaration.final classA field access expression.final classRepresents a field declaration in the body of a type declaration.final classThe "finally" clause of a try statement.final classRepresents a "foreach"-loop on anIterable.final classThe initialization clause of a for loop.final classFormal parameter node for a formal parameter list.final classA list of formal parameters in a method or constructor declaration.final classRepresents aforloop (distinct from foreach loops).final classUpdate clause of a for statement.final classA guard for refining a switch case inASTSwitchLabels.final classRepresents anifstatement, possibly with anelsestatement.final classRepresents theimplementsclause of a class declaration.final classA class declaration added by the compiler implicitly in a compact compilation unit (see JEP 512, Java 25).final classRepresents an import declaration in a Java file.final classRepresents a binary infix expression.final classA class or instance initializer.final classRepresents an intersection type.final classA wrapper around a statement that assigns it a label.final classA lambda expression.final classFormal parameter of a lambda expression.final classThe parameter list of a lambda expression.classCommon supertype for nodes that act as a kind of list of other nodes.final classA statement that contains a local class declaration.final classRepresents a local variable declaration.final classRepresents an array of member values in an annotation member value.final classRepresents a single pair of member name to value in an annotation.final classA method invocation expression.final classA method declaration, in a class or interface declaration.final classMethod or constructor reference expression.final classList of modifiers of a declaration.final classA module declaration.classA directive of a module declaration.final classAn "exports" directive of a module declaration.final classThe name of a module.final classAn "opens" directive of a module declaration.final classA "provides" directive of a module declaration.final classA "requires" directive of a module declaration.final classA "uses" directive of a module declaration.final classThe null literal.final classA numeric literal of any type (double, int, long, float, etc).final classPackage declaration at the top of a source file.final classWraps aASTPatternnode but presents the interface ofASTExpression.final classContains a potentially empty list of nested Patterns for RecordPattern (Java 21).final classRepresents thepermitsclause of a (sealed) class declaration.final classRepresents a primitive type.final classReceiver parameter.final classDefines the body of a RecordDeclaration (JDK 16 feature).final classDefines a single component of a RecordDeclaration (JDK 16 feature).final classDefines the state description of a RecordDeclaration (JDK 16 feature).final classA record declaration is a special data class type (JDK 16 feature).final classA record pattern, a Java 21 language feature.final classA resource of a try-with-resources.final classA list of resources in a try-with-resources.final classA return statement in a method or constructor body.final classA list of statement expressions.final classRepresents a string literal.final classThe "super" keyword.final classA non-fallthrough switch rule, introduced with switch expressions.final classA switch expression, as introduced in Java 12.final classA fallthrough switch branch.final classfinal classRepresents aswitchstatement.final classA synchronized statement.final classThe "this" expression.final classThrows clause of anASTConstructorDeclarationorASTMethodDeclaration.final classAthrowstatement.final classTry statement node.final classRepresents a list of type arguments.classBody of a type declaration.final classWraps a type node but presents the interface ofASTExpression.final classRepresents a type parameter declaration of a method, constructor, class or interface declaration.final classRepresents a list of type parameters.final classA type pattern (JDK16).final classRepresents a unary operation on a value.final classRepresents the type node of a multi-catch statement.final classAn unnamed pattern, a Java 22 language feature.final classAn unqualified reference to a variable (either local, or a field that is in scope).classGroups a variable ID and its initializer if it exists.final classRepresents an identifier in the context of variable or parameter declarations (not their use in expressions).final classType node to represent the void pseudo-type.final classRepresents awhileloop.final classRepresents a wildcard type.classAyieldstatement in a switch expression.Methods in net.sourceforge.pmd.lang.java.ast with type parameters of type JavaNodeModifier and TypeMethodDescriptionReturns an empty list if the parameter is null, otherwise returns itsASTList.toList().static <N extends JavaNode>
@NonNull NodeStream<N>ASTList.orEmptyStream(@Nullable ASTList<N> list) static <N extends JavaNode>
@Nullable NASTList.singleOrNull(@Nullable ASTList<N> list) Returns the element if there is exactly one, otherwise returns null.Methods in net.sourceforge.pmd.lang.java.ast with parameters of type JavaNodeModifier and TypeMethodDescriptionstatic net.sourceforge.pmd.lang.java.types.internal.infer.InferInternalApiBridge.getInferenceEntryPoint(JavaNode n) static @NonNull net.sourceforge.pmd.lang.java.types.ast.internal.LazyTypeResolverInternalApiBridge.getLazyTypeResolver(JavaNode n) static Stream<JavaComment>JavaComment.getLeadingComments(JavaNode node) static net.sourceforge.pmd.lang.java.internal.JavaAstProcessorInternalApiBridge.getProcessor(JavaNode n) static booleanUnaryOp.isUnaryExprWithOperator(@Nullable JavaNode e, Set<UnaryOp> operators) Tests if the node is anASTUnaryExpressionwith one of the given operators.static booleanUnaryOp.isUnaryExprWithOperator(@Nullable JavaNode e, UnaryOp operator) Tests if the node is anASTUnaryExpressionwith the given operator.static voidInternalApiBridge.setSymbolTable(JavaNode node, JSymbolTable table) default RJavaVisitor.visitJavaNode(JavaNode node, P data) Method parameters in net.sourceforge.pmd.lang.java.ast with type arguments of type JavaNodeModifier and TypeMethodDescriptionstatic voidInternalApiBridge.disambigWithCtx(NodeStream<? extends JavaNode> nodes, net.sourceforge.pmd.lang.java.symbols.table.internal.ReferenceCtx ctx) -
Uses of JavaNode in net.sourceforge.pmd.lang.java.metrics
Fields in net.sourceforge.pmd.lang.java.metrics with type parameters of type JavaNodeModifier and TypeFieldDescriptionJavaMetrics.ACCESS_TO_FOREIGN_DATANumber of usages of foreign attributes, both directly and through accessors.JavaMetrics.FAN_OUTThis counts the number of other classes a given class or operation relies on.JavaMetrics.LINES_OF_CODESimply counts the number of lines of code the operation or class takes up in the source.JavaMetrics.NCSSNumber of statements in a class or operation. -
Uses of JavaNode in net.sourceforge.pmd.lang.java.rule
Methods in net.sourceforge.pmd.lang.java.rule with parameters of type JavaNodeModifier and TypeMethodDescriptionAbstractJavaRulechainRule.visitJavaNode(JavaNode node, Object data) Constructor parameters in net.sourceforge.pmd.lang.java.rule with type arguments of type JavaNodeModifierConstructorDescriptionAbstractJavaRulechainRule(Class<? extends JavaNode> first, Class<? extends JavaNode>... visits) Specify the node types to visit as parameters. -
Uses of JavaNode in net.sourceforge.pmd.lang.java.rule.bestpractices
Methods in net.sourceforge.pmd.lang.java.rule.bestpractices with parameters of type JavaNodeModifier and TypeMethodDescriptionUnusedPrivateFieldRule.visitJavaNode(JavaNode node, Object data) -
Uses of JavaNode in net.sourceforge.pmd.lang.java.rule.codestyle
Methods in net.sourceforge.pmd.lang.java.rule.codestyle with parameters of type JavaNodeModifier and TypeMethodDescriptionUselessParenthesesRule.needsParentheses(ASTExpression inner, JavaNode outer) FieldDeclarationsShouldBeAtStartOfClassRule.visitJavaNode(JavaNode node, Object data) UselessParenthesesRule.visitJavaNode(JavaNode node, Object data) -
Uses of JavaNode in net.sourceforge.pmd.lang.java.rule.design
Methods in net.sourceforge.pmd.lang.java.rule.design with parameters of type JavaNodeModifier and TypeMethodDescriptionCyclomaticComplexityRule.visitJavaNode(JavaNode node, Object param) DataClassRule.visitJavaNode(JavaNode node, Object data) NcssCountRule.visitJavaNode(JavaNode node, Object data) NPathComplexityRule.visitJavaNode(JavaNode node, Object data) SingularFieldRule.visitJavaNode(JavaNode node, Object data) -
Uses of JavaNode in net.sourceforge.pmd.lang.java.symbols
Methods in net.sourceforge.pmd.lang.java.symbols that return JavaNodeModifier and TypeMethodDescriptiondefault @Nullable JavaNodeJElementSymbol.tryGetNode()Returns the node that declares this symbol. -
Uses of JavaNode in net.sourceforge.pmd.lang.java.types
Methods in net.sourceforge.pmd.lang.java.types with parameters of type JavaNodeModifier and TypeMethodDescriptionbooleanReturns true if any of the matchers match the node.booleanInvocationMatcher.matchesCall(@Nullable JavaNode node)