Uses of Interface
net.sourceforge.pmd.lang.java.ast.JavaNode
-
Packages that use JavaNode Package Description net.sourceforge.pmd.lang.java.ast Contains the classes and interfaces modelling the Java AST.net.sourceforge.pmd.lang.java.metrics net.sourceforge.pmd.lang.java.rule Contains the built-in rules bundled with the Java distribution.net.sourceforge.pmd.lang.java.rule.bestpractices net.sourceforge.pmd.lang.java.rule.codestyle net.sourceforge.pmd.lang.java.rule.design net.sourceforge.pmd.lang.java.symbols The new symbol resolution framework that inter-operates cleanly with type resolution.net.sourceforge.pmd.lang.java.types 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 JavaNode Modifier and Type Class Description class
ASTList<N extends JavaNode>
Common supertype for nodes that act as a kind of list of other nodes.Subinterfaces of JavaNode in net.sourceforge.pmd.lang.java.ast Modifier and Type Interface Description interface
Annotatable
Marks nodes that can be annotated.interface
ASTAssignableExpr
An expression that may be assigned by an assignment expression, or incremented or decremented.static interface
ASTAssignableExpr.ASTNamedReferenceExpr
An assignable expression that has a name, and refers to a symbol.interface
ASTBodyDeclaration
Marker interface for declarations that can occur in a type body, such as field or method declarations.interface
ASTExecutableDeclaration
Groups method and constructor declarations under a common type.interface
ASTExpression
Represents an expression, in the most general sense.interface
ASTLiteral
A lexical literal.interface
ASTLoopStatement
A loop statement.interface
ASTMemberValue
Represents the value of a member of an annotation.interface
ASTPattern
A pattern for pattern matching constructs likeInstanceOfExpression
or within aASTSwitchLabel
).interface
ASTPrimaryExpression
Tags thoseexpressions
that are categorised as primary by the JLS.interface
ASTReferenceType
Represents a reference type, i.e. a class or interface type, or an array type.interface
ASTStatement
Represents a code statement.interface
ASTSwitchArrowRHS
A node that can appear as the right-hand-side of aSwitchArrowRule
.interface
ASTSwitchBranch
A branch of aSwitchLike
.interface
ASTSwitchLike
Common supertype for switch statements and switch expressions.interface
ASTTopLevelDeclaration
Marker interface for nodes that can appear on the top-level of a file.interface
ASTType
Represents a type reference.interface
ASTTypeDeclaration
Groups class, enum, record, annotation and interface declarations under a common supertype.interface
FunctionalExpression
A method reference or lambda expression.interface
InvocationNode
Groups method and constructor call, together, as well as explicit constructor invocation statements, and enum constant declarations.interface
JavadocCommentOwner
A node that may own a javadoc comment.interface
MethodUsage
A node that uses another method or constructor.interface
ModifierOwner
A node that owns a modifier list.interface
QualifiableExpression
Node that may be qualified by an expression, e.g. an instance method call or inner class constructor invocation.interface
SymbolDeclaratorNode
A node that declares a corresponding symbol.interface
TypeNode
A node that has a statically known type.interface
TypeParamOwnerNode
A symbol declaration, whose symbol can declare type parameters.Classes in net.sourceforge.pmd.lang.java.ast that implement JavaNode Modifier and Type Class Description class
AbstractPackageNameModuleDirective
class
ASTAmbiguousName
An ambiguous name occurring in any context.class
ASTAnnotation
Represents an annotation.class
ASTAnnotationMemberList
Represents the list ofmember-value pairs
in anannotation
.class
ASTAnnotationTypeBody
class
ASTAnnotationTypeDeclaration
The declaration of an annotation type.class
ASTAnonymousClassDeclaration
An anonymous class declaration.class
ASTArgumentList
class
ASTArrayAccess
An array access expression.class
ASTArrayAllocation
An array creation expression.class
ASTArrayDimensions
Represents array type dimensions.class
ASTArrayDimExpr
Represents an array dimension initialized with an expression in an array allocation expression.class
ASTArrayInitializer
An array initializer.class
ASTArrayType
Represents an array type.class
ASTArrayTypeDim
Represents an array dimension in an array type, or in an array allocation expression.class
ASTAssertStatement
Represents anassert
statement.class
ASTAssignmentExpression
Represents an assignment expression.class
ASTBlock
A block of code.class
ASTBooleanLiteral
The boolean literal, either "true" or "false".class
ASTBreakStatement
A break statement, that jumps to a named label (or exits the current loop).class
ASTCastExpression
Represents a type cast expression.class
ASTCatchClause
A "catch" clause of a try statement.class
ASTCatchParameter
Formal parameter of a catch clause to represent the declared exception variable.class
ASTCharLiteral
Represents a character literal.class
ASTClassBody
Represents the body of a class or interface declaration.class
ASTClassDeclaration
Represents class and interface declarations.class
ASTClassLiteral
A class literal.class
ASTClassType
Represents a class or interface type, possibly parameterised with type arguments.class
ASTCompactConstructorDeclaration
This defines a compact constructor for a RecordDeclaration (JDK 16 feature).class
ASTCompilationUnit
The root node of all Java ASTs.class
ASTConditionalExpression
Represents a conditional expression, aka ternary expression.class
ASTConstructorCall
A class instance creation expression.class
ASTConstructorDeclaration
class
ASTContinueStatement
A continue statement, that jumps to the next iteration of an enclosing loop.class
ASTDefaultValue
Represents thedefault
clause of an annotation method.class
ASTDoStatement
Represents ado ... while
statement.class
ASTEmptyDeclaration
An empty declaration (useless).class
ASTEmptyStatement
An empty statement (useless).class
ASTEnumBody
Body of an enum declaration.class
ASTEnumConstant
Represents an enum constant declaration within an enum type declaration.class
ASTEnumDeclaration
Represents an enum declaration.class
ASTExplicitConstructorInvocation
An explicit constructor invocation, occurring at the start of a constructor declaration.class
ASTExpressionStatement
A statement that contains an expression.class
ASTExtendsList
Represents theextends
clause of a class or interface declaration.class
ASTFieldAccess
A field access expression.class
ASTFieldDeclaration
Represents a field declaration in the body of a type declaration.class
ASTFinallyClause
The "finally" clause of a try statement.class
ASTForeachStatement
Represents a "foreach"-loop on anIterable
.class
ASTForInit
The initialization clause of a for loop.class
ASTFormalParameter
Formal parameter node for a formal parameter list.class
ASTFormalParameters
A list of formal parameters in a method or constructor declaration.class
ASTForStatement
Represents afor
loop (distinct from foreach loops).class
ASTForUpdate
Update clause of a for statement.class
ASTGuard
A guard for refining a switch case inASTSwitchLabel
s.class
ASTIfStatement
Represents anif
statement, possibly with anelse
statement.class
ASTImplementsList
Represents theimplements
clause of a class declaration.class
ASTImplicitClassDeclaration
ImplicitClassDeclaration ::= ClassBody ClassBody ::= FieldDeclaration* MethodDeclaration BodyDeclaration*class
ASTImportDeclaration
Represents an import declaration in a Java file.class
ASTInfixExpression
Represents a binary infix expression.class
ASTInitializer
A class or instance initializer.class
ASTIntersectionType
Represents an intersection type.class
ASTLabeledStatement
A wrapper around a statement that assigns it a label.class
ASTLambdaExpression
A lambda expression.class
ASTLambdaParameter
Formal parameter of a lambda expression.class
ASTLambdaParameterList
The parameter list of a lambda expression.class
ASTList<N extends JavaNode>
Common supertype for nodes that act as a kind of list of other nodes.class
ASTLocalClassStatement
A statement that contains a local class declaration.class
ASTLocalVariableDeclaration
Represents a local variable declaration.class
ASTMemberValueArrayInitializer
Represents an array of member values in an annotation member value.class
ASTMemberValuePair
Represents a single pair of member name to value in an annotation.class
ASTMethodCall
A method invocation expression.class
ASTMethodDeclaration
A method declaration, in a class or interface declaration.class
ASTMethodReference
Method or constructor reference expression.class
ASTModifierList
List of modifiers of a declaration.class
ASTModuleDeclaration
A module declaration.class
ASTModuleDirective
A directive of a module declaration.class
ASTModuleExportsDirective
An "exports" directive of a module declaration.class
ASTModuleName
The name of a module.class
ASTModuleOpensDirective
An "opens" directive of a module declaration.class
ASTModuleProvidesDirective
A "provides" directive of a module declaration.class
ASTModuleRequiresDirective
A "requires" directive of a module declaration.class
ASTModuleUsesDirective
A "uses" directive of a module declaration.class
ASTNullLiteral
The null literal.class
ASTNumericLiteral
A numeric literal of any type (double, int, long, float, etc).class
ASTPackageDeclaration
Package declaration at the top of a source file.class
ASTPatternExpression
Wraps aASTPattern
node but presents the interface ofASTExpression
.class
ASTPatternList
Contains a potentially empty list of nested Patterns for RecordPattern (Java 21).class
ASTPermitsList
Represents thepermits
clause of a (sealed) class declaration.class
ASTPrimitiveType
Represents a primitive type.class
ASTReceiverParameter
Receiver parameter.class
ASTRecordBody
Defines the body of a RecordDeclaration (JDK 16 feature).class
ASTRecordComponent
Defines a single component of a RecordDeclaration (JDK 16 feature).class
ASTRecordComponentList
Defines the state description of a RecordDeclaration (JDK 16 feature).class
ASTRecordDeclaration
A record declaration is a special data class type (JDK 16 feature).class
ASTRecordPattern
A record pattern, a Java 21 language feature.class
ASTResource
A resource of a try-with-resources.class
ASTResourceList
A list of resources in a try-with-resources.class
ASTReturnStatement
A return statement in a method or constructor body.class
ASTStatementExpressionList
A list of statement expressions.class
ASTStringLiteral
Represents a string literal.class
ASTSuperExpression
The "super" keyword.class
ASTSwitchArrowBranch
A non-fallthrough switch rule, introduced with switch expressions.class
ASTSwitchExpression
A switch expression, as introduced in Java 12.class
ASTSwitchFallthroughBranch
A fallthrough switch branch.class
ASTSwitchLabel
class
ASTSwitchStatement
Represents aswitch
statement.class
ASTSynchronizedStatement
A synchronized statement.class
ASTTemplate
The template of aASTTemplateExpression
.class
ASTTemplateExpression
A string template expression.class
ASTTemplateFragment
This is a Java 21/22 Preview feature.class
ASTThisExpression
The "this" expression.class
ASTThrowsList
Throws clause of anASTConstructorDeclaration
orASTMethodDeclaration
.class
ASTThrowStatement
Athrow
statement.class
ASTTryStatement
Try statement node.class
ASTTypeArguments
Represents a list of type arguments.class
ASTTypeBody
Body of a type declaration.class
ASTTypeExpression
Wraps a type node but presents the interface ofASTExpression
.class
ASTTypeParameter
Represents a type parameter declaration of a method, constructor, class or interface declaration.class
ASTTypeParameters
Represents a list of type parameters.class
ASTTypePattern
A type pattern (JDK16).class
ASTUnaryExpression
Represents a unary operation on a value.class
ASTUnionType
Represents the type node of a multi-catch statement.class
ASTUnnamedPattern
An unnamed pattern, a Java 22 language feature.class
ASTVariableAccess
An unqualified reference to a variable (either local, or a field that is in scope).class
ASTVariableDeclarator
Groups a variable ID and its initializer if it exists.class
ASTVariableId
Represents an identifier in the context of variable or parameter declarations (not their use in expressions).class
ASTVoidType
Type node to represent the void pseudo-type.class
ASTWhileStatement
Represents awhile
loop.class
ASTWildcardType
Represents a wildcard type.class
ASTYieldStatement
Ayield
statement in a switch expression.Methods in net.sourceforge.pmd.lang.java.ast with type parameters of type JavaNode Modifier and Type Method Description static <N extends JavaNode>
@NonNull List<N>ASTList. orEmpty(@Nullable ASTList<N> list)
Returns an empty list if the parameter is null, otherwise returns itsASTList.toList()
.static <N extends JavaNode>
@NonNull net.sourceforge.pmd.lang.ast.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 that return JavaNode Modifier and Type Method Description JavaNode
ASTTemplateExpression. getTemplateArgument()
Methods in net.sourceforge.pmd.lang.java.ast with parameters of type JavaNode Modifier and Type Method Description static net.sourceforge.pmd.lang.java.types.internal.infer.Infer
InternalApiBridge. getInferenceEntryPoint(JavaNode n)
static @NonNull net.sourceforge.pmd.lang.java.types.ast.internal.LazyTypeResolver
InternalApiBridge. getLazyTypeResolver(JavaNode n)
static Stream<JavaComment>
JavaComment. getLeadingComments(JavaNode node)
static net.sourceforge.pmd.lang.java.internal.JavaAstProcessor
InternalApiBridge. getProcessor(JavaNode n)
static boolean
UnaryOp. isUnaryExprWithOperator(@Nullable JavaNode e, Set<UnaryOp> operators)
Tests if the node is anASTUnaryExpression
with one of the given operators.static boolean
UnaryOp. isUnaryExprWithOperator(@Nullable JavaNode e, UnaryOp operator)
Tests if the node is anASTUnaryExpression
with the given operator.static void
InternalApiBridge. setSymbolTable(JavaNode node, JSymbolTable table)
default R
JavaVisitor. visitJavaNode(JavaNode node, P data)
Method parameters in net.sourceforge.pmd.lang.java.ast with type arguments of type JavaNode Modifier and Type Method Description static void
InternalApiBridge. disambigWithCtx(net.sourceforge.pmd.lang.ast.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 JavaNode Modifier and Type Field Description static net.sourceforge.pmd.lang.metrics.Metric<JavaNode,Integer>
JavaMetrics. ACCESS_TO_FOREIGN_DATA
Number of usages of foreign attributes, both directly and through accessors.static net.sourceforge.pmd.lang.metrics.Metric<JavaNode,Integer>
JavaMetrics. FAN_OUT
This counts the number of other classes a given class or operation relies on.static net.sourceforge.pmd.lang.metrics.Metric<JavaNode,Integer>
JavaMetrics. LINES_OF_CODE
Simply counts the number of lines of code the operation or class takes up in the source.static net.sourceforge.pmd.lang.metrics.Metric<JavaNode,Integer>
JavaMetrics. NCSS
Number 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 JavaNode Modifier and Type Method Description Object
AbstractJavaRulechainRule. visitJavaNode(JavaNode node, Object data)
Constructor parameters in net.sourceforge.pmd.lang.java.rule with type arguments of type JavaNode Constructor Description AbstractJavaRulechainRule(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 JavaNode Modifier and Type Method Description Object
UnusedPrivateFieldRule. 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 JavaNode Modifier and Type Method Description static UselessParenthesesRule.Necessity
UselessParenthesesRule. needsParentheses(ASTExpression inner, JavaNode outer)
Object
FieldDeclarationsShouldBeAtStartOfClassRule. visitJavaNode(JavaNode node, Object data)
Object
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 JavaNode Modifier and Type Method Description Object
CyclomaticComplexityRule. visitJavaNode(JavaNode node, Object param)
Object
DataClassRule. visitJavaNode(JavaNode node, Object data)
Object
NcssCountRule. visitJavaNode(JavaNode node, Object data)
Object
NPathComplexityRule. visitJavaNode(JavaNode node, Object data)
Object
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 JavaNode Modifier and Type Method Description default @Nullable JavaNode
JElementSymbol. 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 JavaNode Modifier and Type Method Description boolean
InvocationMatcher.CompoundInvocationMatcher. anyMatch(JavaNode node)
Returns true if any of the matchers match the node.boolean
InvocationMatcher. matchesCall(@Nullable JavaNode node)
-