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 classASTList<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 interfaceAnnotatableMarks nodes that can be annotated.interfaceASTAssignableExprAn expression that may be assigned by an assignment expression, or incremented or decremented.static interfaceASTAssignableExpr.ASTNamedReferenceExprAn assignable expression that has a name, and refers to a symbol.interfaceASTBodyDeclarationMarker interface for declarations that can occur in a type body, such as field or method declarations.interfaceASTExecutableDeclarationGroups method and constructor declarations under a common type.interfaceASTExpressionRepresents an expression, in the most general sense.interfaceASTLiteralA lexical literal.interfaceASTLoopStatementA loop statement.interfaceASTMemberValueRepresents the value of a member of an annotation.interfaceASTPatternA pattern for pattern matching constructs likeInstanceOfExpressionor within aASTSwitchLabel).interfaceASTPrimaryExpressionTags thoseexpressionsthat are categorised as primary by the JLS.interfaceASTReferenceTypeRepresents a reference type, i.e. a class or interface type, or an array type.interfaceASTStatementRepresents a code statement.interfaceASTSwitchArrowRHSA node that can appear as the right-hand-side of aSwitchArrowRule.interfaceASTSwitchBranchA branch of aSwitchLike.interfaceASTSwitchLikeCommon supertype for switch statements and switch expressions.interfaceASTTopLevelDeclarationMarker interface for nodes that can appear on the top-level of a file.interfaceASTTypeRepresents a type reference.interfaceASTTypeDeclarationGroups class, enum, record, annotation and interface declarations under a common supertype.interfaceFunctionalExpressionA method reference or lambda expression.interfaceInvocationNodeGroups method and constructor call, together, as well as explicit constructor invocation statements, and enum constant declarations.interfaceJavadocCommentOwnerA node that may own a javadoc comment.interfaceMethodUsageA node that uses another method or constructor.interfaceModifierOwnerA node that owns a modifier list.interfaceQualifiableExpressionNode that may be qualified by an expression, e.g. an instance method call or inner class constructor invocation.interfaceReturnScopeNodeMarker interface for those nodes that can be the target of a return statement.interfaceSymbolDeclaratorNodeA node that declares a corresponding symbol.interfaceTypeNodeA node that has a statically known type.interfaceTypeParamOwnerNodeA symbol declaration, whose symbol can declare type parameters.Classes in net.sourceforge.pmd.lang.java.ast that implement JavaNode Modifier and Type Class Description classAbstractPackageNameModuleDirectiveclassASTAmbiguousNameAn ambiguous name occurring in any context.classASTAnnotationRepresents an annotation.classASTAnnotationMemberListRepresents the list ofmember-value pairsin anannotation.classASTAnnotationTypeBodyclassASTAnnotationTypeDeclarationThe declaration of an annotation type.classASTAnonymousClassDeclarationAn anonymous class declaration.classASTArgumentListclassASTArrayAccessAn array access expression.classASTArrayAllocationAn array creation expression.classASTArrayDimensionsRepresents array type dimensions.classASTArrayDimExprRepresents an array dimension initialized with an expression in an array allocation expression.classASTArrayInitializerAn array initializer.classASTArrayTypeRepresents an array type.classASTArrayTypeDimRepresents an array dimension in an array type, or in an array allocation expression.classASTAssertStatementRepresents anassertstatement.classASTAssignmentExpressionRepresents an assignment expression.classASTBlockA block of code.classASTBooleanLiteralThe boolean literal, either "true" or "false".classASTBreakStatementA break statement, that jumps to a named label (or exits the current loop).classASTCastExpressionRepresents a type cast expression.classASTCatchClauseA "catch" clause of a try statement.classASTCatchParameterFormal parameter of a catch clause to represent the declared exception variable.classASTCharLiteralRepresents a character literal.classASTClassBodyRepresents the body of a class or interface declaration.classASTClassDeclarationRepresents class and interface declarations.classASTClassLiteralA class literal.classASTClassTypeRepresents a class or interface type, possibly parameterised with type arguments.classASTCompactConstructorDeclarationThis defines a compact constructor for a RecordDeclaration (JDK 16 feature).classASTCompilationUnitThe root node of all Java ASTs.classASTConditionalExpressionRepresents a conditional expression, aka ternary expression.classASTConstructorCallA class instance creation expression.classASTConstructorDeclarationclassASTContinueStatementA continue statement, that jumps to the next iteration of an enclosing loop.classASTDefaultValueRepresents thedefaultclause of an annotation method.classASTDoStatementRepresents ado ... whilestatement.classASTEmptyDeclarationAn empty declaration (useless).classASTEmptyStatementAn empty statement (useless).classASTEnumBodyBody of an enum declaration.classASTEnumConstantRepresents an enum constant declaration within an enum type declaration.classASTEnumDeclarationRepresents an enum declaration.classASTExplicitConstructorInvocationAn explicit constructor invocation, occurring at the start of a constructor declaration.classASTExpressionStatementA statement that contains an expression.classASTExtendsListRepresents theextendsclause of a class or interface declaration.classASTFieldAccessA field access expression.classASTFieldDeclarationRepresents a field declaration in the body of a type declaration.classASTFinallyClauseThe "finally" clause of a try statement.classASTForeachStatementRepresents a "foreach"-loop on anIterable.classASTForInitThe initialization clause of a for loop.classASTFormalParameterFormal parameter node for a formal parameter list.classASTFormalParametersA list of formal parameters in a method or constructor declaration.classASTForStatementRepresents aforloop (distinct from foreach loops).classASTForUpdateUpdate clause of a for statement.classASTGuardA guard for refining a switch case inASTSwitchLabels.classASTIfStatementRepresents anifstatement, possibly with anelsestatement.classASTImplementsListRepresents theimplementsclause of a class declaration.classASTImplicitClassDeclarationA class declaration added by the compiler implicitly in a compact compilation unit (see JEP 512, Java 25).classASTImportDeclarationRepresents an import declaration in a Java file.classASTInfixExpressionRepresents a binary infix expression.classASTInitializerA class or instance initializer.classASTIntersectionTypeRepresents an intersection type.classASTLabeledStatementA wrapper around a statement that assigns it a label.classASTLambdaExpressionA lambda expression.classASTLambdaParameterFormal parameter of a lambda expression.classASTLambdaParameterListThe parameter list of a lambda expression.classASTList<N extends JavaNode>Common supertype for nodes that act as a kind of list of other nodes.classASTLocalClassStatementA statement that contains a local class declaration.classASTLocalVariableDeclarationRepresents a local variable declaration.classASTMemberValueArrayInitializerRepresents an array of member values in an annotation member value.classASTMemberValuePairRepresents a single pair of member name to value in an annotation.classASTMethodCallA method invocation expression.classASTMethodDeclarationA method declaration, in a class or interface declaration.classASTMethodReferenceMethod or constructor reference expression.classASTModifierListList of modifiers of a declaration.classASTModuleDeclarationA module declaration.classASTModuleDirectiveA directive of a module declaration.classASTModuleExportsDirectiveAn "exports" directive of a module declaration.classASTModuleNameThe name of a module.classASTModuleOpensDirectiveAn "opens" directive of a module declaration.classASTModuleProvidesDirectiveA "provides" directive of a module declaration.classASTModuleRequiresDirectiveA "requires" directive of a module declaration.classASTModuleUsesDirectiveA "uses" directive of a module declaration.classASTNullLiteralThe null literal.classASTNumericLiteralA numeric literal of any type (double, int, long, float, etc).classASTPackageDeclarationPackage declaration at the top of a source file.classASTPatternExpressionWraps aASTPatternnode but presents the interface ofASTExpression.classASTPatternListContains a potentially empty list of nested Patterns for RecordPattern (Java 21).classASTPermitsListRepresents thepermitsclause of a (sealed) class declaration.classASTPrimitiveTypeRepresents a primitive type.classASTReceiverParameterReceiver parameter.classASTRecordBodyDefines the body of a RecordDeclaration (JDK 16 feature).classASTRecordComponentDefines a single component of a RecordDeclaration (JDK 16 feature).classASTRecordComponentListDefines the state description of a RecordDeclaration (JDK 16 feature).classASTRecordDeclarationA record declaration is a special data class type (JDK 16 feature).classASTRecordPatternA record pattern, a Java 21 language feature.classASTResourceA resource of a try-with-resources.classASTResourceListA list of resources in a try-with-resources.classASTReturnStatementA return statement in a method or constructor body.classASTStatementExpressionListA list of statement expressions.classASTStringLiteralRepresents a string literal.classASTSuperExpressionThe "super" keyword.classASTSwitchArrowBranchA non-fallthrough switch rule, introduced with switch expressions.classASTSwitchExpressionA switch expression, as introduced in Java 12.classASTSwitchFallthroughBranchA fallthrough switch branch.classASTSwitchLabelclassASTSwitchStatementRepresents aswitchstatement.classASTSynchronizedStatementA synchronized statement.classASTThisExpressionThe "this" expression.classASTThrowsListThrows clause of anASTConstructorDeclarationorASTMethodDeclaration.classASTThrowStatementAthrowstatement.classASTTryStatementTry statement node.classASTTypeArgumentsRepresents a list of type arguments.classASTTypeBodyBody of a type declaration.classASTTypeExpressionWraps a type node but presents the interface ofASTExpression.classASTTypeParameterRepresents a type parameter declaration of a method, constructor, class or interface declaration.classASTTypeParametersRepresents a list of type parameters.classASTTypePatternA type pattern (JDK16).classASTUnaryExpressionRepresents a unary operation on a value.classASTUnionTypeRepresents the type node of a multi-catch statement.classASTUnnamedPatternAn unnamed pattern, a Java 22 language feature.classASTVariableAccessAn unqualified reference to a variable (either local, or a field that is in scope).classASTVariableDeclaratorGroups a variable ID and its initializer if it exists.classASTVariableIdRepresents an identifier in the context of variable or parameter declarations (not their use in expressions).classASTVoidTypeType node to represent the void pseudo-type.classASTWhileStatementRepresents awhileloop.classASTWildcardTypeRepresents a wildcard type.classASTYieldStatementAyieldstatement 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 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 JavaNode Modifier and Type Method Description static 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 JavaNode Modifier and Type Method Description static 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 JavaNode Modifier and Type Field Description static Metric<JavaNode,Integer>JavaMetrics. ACCESS_TO_FOREIGN_DATANumber of usages of foreign attributes, both directly and through accessors.static Metric<JavaNode,Integer>JavaMetrics. FAN_OUTThis counts the number of other classes a given class or operation relies on.static Metric<JavaNode,Integer>JavaMetrics. LINES_OF_CODESimply counts the number of lines of code the operation or class takes up in the source.static Metric<JavaNode,Integer>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 JavaNode Modifier and Type Method Description ObjectAbstractJavaRulechainRule. 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 ObjectUnusedPrivateFieldRule. 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.NecessityUselessParenthesesRule. needsParentheses(ASTExpression inner, JavaNode outer)ObjectFieldDeclarationsShouldBeAtStartOfClassRule. visitJavaNode(JavaNode node, Object data)ObjectUselessParenthesesRule. 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 ObjectCyclomaticComplexityRule. visitJavaNode(JavaNode node, Object param)ObjectDataClassRule. visitJavaNode(JavaNode node, Object data)ObjectNcssCountRule. visitJavaNode(JavaNode node, Object data)ObjectNPathComplexityRule. visitJavaNode(JavaNode node, Object data)ObjectSingularFieldRule. 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 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 JavaNode Modifier and Type Method Description booleanInvocationMatcher.CompoundInvocationMatcher. anyMatch(JavaNode node)Returns true if any of the matchers match the node.booleanInvocationMatcher. matchesCall(@Nullable JavaNode node)
-