Uses of Interface
net.sourceforge.pmd.lang.ast.Node
-
Packages that use Node Package Description net.sourceforge.pmd.lang net.sourceforge.pmd.lang.ast net.sourceforge.pmd.lang.ast.impl net.sourceforge.pmd.lang.ast.impl.antlr4 net.sourceforge.pmd.lang.ast.impl.javacc Support classes for language implementations based on JavaCC.net.sourceforge.pmd.lang.metrics Language-independent framework to represent code metrics.net.sourceforge.pmd.lang.rule net.sourceforge.pmd.lang.rule.impl net.sourceforge.pmd.lang.rule.xpath net.sourceforge.pmd.lang.rule.xpath.impl net.sourceforge.pmd.lang.symboltable net.sourceforge.pmd.reporting Logic about reporting: violations, suppression etc.net.sourceforge.pmd.util.designerbindings net.sourceforge.pmd.util.treeexport -
-
Uses of Node in net.sourceforge.pmd.lang
Classes in net.sourceforge.pmd.lang that implement Node Modifier and Type Class Description static classPlainTextLanguage.PlainTextFileThe only node produced by the parser ofPlainTextLanguage. -
Uses of Node in net.sourceforge.pmd.lang.ast
Classes in net.sourceforge.pmd.lang.ast with type parameters of type Node Modifier and Type Interface Description interfaceNodeStream<T extends Node>A sequence of AST nodes.static interfaceNodeStream.DescendantNodeStream<T extends Node>A specialization ofNodeStreamthat allows configuring tree traversal behaviour when traversing the descendants of a node.Subinterfaces of Node in net.sourceforge.pmd.lang.ast Modifier and Type Interface Description interfaceRootNodeThis interface identifies the root node of an AST.interfaceTextAvailableNodeRefinement ofNodefor nodes that can provide the underlying source text.Fields in net.sourceforge.pmd.lang.ast with type parameters of type Node Modifier and Type Field Description static Comparator<Node>Node. COORDS_COMPARATORCompares nodes according to their location in the file.Methods in net.sourceforge.pmd.lang.ast with type parameters of type Node Modifier and Type Method Description default <R extends Node>
NodeStream<R>Node. ancestors(Class<? extends R> rClass)Returns the ancestor stream of this node filtered by the given node type.default <R extends Node>
NodeStream<R>NodeStream. ancestors(Class<? extends R> rClass)Returns the ancestor stream of each node in this stream, filtered by the given node type.default <R extends Node>
NodeStream<R>Node. children(Class<? extends R> rClass)Returns a node stream of the children of this node that are of the given type.default <R extends Node>
NodeStream<R>NodeStream. children(Class<? extends R> rClass)Returns the children stream of each node in this stream, filtered by the given node type.default <R extends Node>
NodeStream.DescendantNodeStream<R>Node. descendants(Class<? extends R> rClass)Returns a node stream of the descendants of this node that are of the given type.<R extends Node>
NodeStream.DescendantNodeStream<R>NodeStream. descendants(Class<? extends R> rClass)Returns the descendant stream of each node in this stream, filtered by the given node type.static <T extends Node>
NodeStream<T>NodeStream. empty()Returns an empty node stream.default <R extends Node>
NodeStream<R>NodeStream. filterIs(Class<? extends R> rClass)Filters the nodes of this stream that are a subtype of the given class.default <R extends Node>
@Nullable RNodeStream. first(Class<? extends R> rClass)Returns the first element of this stream of the given type, ornullif there is none.default <R extends Node>
@Nullable RNode. firstChild(Class<? extends R> rClass)Returns the first child of this node that has the given type.default <R extends Node>
NodeStream<R>NodeStream. firstChild(Class<? extends R> rClass)Returns a stream containing the first child of each of the nodes in this stream that has the given type.default <R extends Node>
@Nullable RNodeStream. firstNonNull(Function<? super @NonNull T,? extends @Nullable R> nullableFun)Returns the first element of this stream for which the mapping function returns a non-null result.<R extends Node>
NodeStream<R>NodeStream. flatMap(Function<? super @NonNull T,? extends @Nullable NodeStream<? extends R>> mapper)Returns a node stream consisting of the results of replacing each node of this stream with the contents of a stream produced by the given mapping function.static <T extends Node,R extends Node>
NodeStream<R>NodeStream. forkJoin(NodeStream<? extends T> upstream, Function<? super @NonNull T,? extends NodeStream<? extends R>> fst, Function<? super @NonNull T,? extends NodeStream<? extends R>> snd, Function<? super @NonNull T,? extends NodeStream<? extends R>>... rest)Applies the given mapping functions to the given upstream in order and merges the results into a new node stream.static <T extends Node,R extends Node>
NodeStream<R>NodeStream. forkJoin(NodeStream<? extends T> upstream, Function<? super @NonNull T,? extends NodeStream<? extends R>> fst, Function<? super @NonNull T,? extends NodeStream<? extends R>> snd, Function<? super @NonNull T,? extends NodeStream<? extends R>>... rest)Applies the given mapping functions to the given upstream in order and merges the results into a new node stream.static <T extends Node>
NodeStream<T>NodeStream. fromIterable(Iterable<? extends @Nullable T> iterable)Returns a new node stream that contains the same elements as the given iterable.default <R extends Node>
@Nullable RNodeStream. last(Class<? extends R> rClass)Returns the last element of this stream of the given type, ornullif there is none.<R extends Node>
NodeStream<R>NodeStream. map(Function<? super @NonNull T,? extends @Nullable R> mapper)Returns a node stream consisting of the results of applying the given mapping function to the node of this stream.static <T extends Node>
NodeStream<T>NodeStream. of(@Nullable T node)Returns a node stream containing zero or one node, depending on whether the argument is null or not.static <T extends Node>
NodeStream<T>NodeStream. of(T... nodes)Returns a node stream whose elements are the given nodes in order.static <T extends Node>
NodeStream<T>NodeStream. ofOptional(Optional<? extends T> optNode)Returns a node stream containing zero or one node, depending on whether the optional is empty or not.static <T extends Node>
NodeStream<T>NodeStream. union(Iterable<? extends NodeStream<? extends T>> streams)Returns a node stream containing all the elements of the given streams, one after the other.static <T extends Node>
NodeStream<T>NodeStream. union(NodeStream<? extends T>... streams)Returns a node stream containing all the elements of the given streams, one after the other.Methods in net.sourceforge.pmd.lang.ast that return Node Modifier and Type Method Description NodeNode. getChild(int index)Returns the child of this node at the given index.default @Nullable NodeNode. getFirstChild()Returns the first child of this node, or null if it doesn't exist.default @Nullable NodeNode. getLastChild()Returns the first last of this node, or null if it doesn't exist.default @Nullable NodeNode. getNextSibling()Returns the next sibling of this node, or null if it does not exist.NodeNode. getParent()Returns the parent of this node, or null if this is the root of the tree.default @Nullable NodeNode. getPreviousSibling()Returns the previous sibling of this node, or null if it does not exist.Methods in net.sourceforge.pmd.lang.ast that return types with arguments of type Node Modifier and Type Method Description default NodeStream<? extends Node>Node. ancestors()Returns a node stream containing all the strict ancestors of this node, in innermost to outermost order.default NodeStream<Node>NodeStream. ancestors()Returns a node stream containing all the ancestors of the nodes contained in this stream.default NodeStream<? extends Node>Node. ancestorsOrSelf()Returns a node stream containing this node and its ancestors.default NodeStream<Node>NodeStream. ancestorsOrSelf()Returns a node stream containing the nodes contained in this stream and their ancestors.default NodeStream<? extends Node>Node. asStream()Returns a node stream containing only this node.default NodeStream<? extends Node>Node. children()Returns a node stream containing all the children of this node.default NodeStream<Node>NodeStream. children()Returns a node stream containing all the children of the nodes contained in this stream.default NodeStream.DescendantNodeStream<? extends Node>Node. descendants()Returns a node stream containing all the descendants of this node.NodeStream.DescendantNodeStream<Node>NodeStream. descendants()Returns a node stream containing all the strict descendants of the nodes contained in this stream.default NodeStream.DescendantNodeStream<? extends Node>Node. descendantsOrSelf()Returns a node stream containing this node, then all its descendants.NodeStream.DescendantNodeStream<Node>NodeStream. descendantsOrSelf()Returns a node stream containing the nodes contained in this stream and their descendants.default NodeStream<Node>NodeStream. followingSiblings()Returns a node stream containing all the following siblings of the nodes contained in this stream.default NodeStream<Node>NodeStream. parents()Returns a node stream containing all the (first-degree) parents of the nodes contained in this stream.default NodeStream<Node>NodeStream. precedingSiblings()Returns a node stream containing all the preceding siblings of the nodes contained in this stream.Methods in net.sourceforge.pmd.lang.ast with parameters of type Node Modifier and Type Method Description default RAstVisitor. cannotVisit(Node node, P param)Called by a node when it detects that the visitor is not of the language it is used to visiting.default intNode. compareLocation(Node other)Compare the coordinates of this node with the other one as if withCOORDS_COMPARATOR.SemanticExceptionSemanticErrorReporter. error(Node location, String message, Object... formatArgs)Report an error at the given location.static <T extends Node>
NodeStream<T>NodeStream. of(T... nodes)Returns a node stream whose elements are the given nodes in order.protected RAstVisitorBase. visitChildren(Node node, P data)Visit the children.RAstVisitor. visitNode(Node node, P param)Visit a node.RAstVisitorBase. visitNode(Node node, P param)voidSemanticErrorReporter. warning(Node location, String message, Object... formatArgs)Report a warning at the given location. -
Uses of Node in net.sourceforge.pmd.lang.ast.impl
Classes in net.sourceforge.pmd.lang.ast.impl with type parameters of type Node Modifier and Type Class Description classAbstractNode<B extends AbstractNode<B,N>,N extends Node & GenericNode<N>>Base class for implementations of the Node interface whose children are stored in an array.Subinterfaces of Node in net.sourceforge.pmd.lang.ast.impl Modifier and Type Interface Description interfaceGenericNode<N extends GenericNode<N>>Interface that binds the return type of some node methods to a type parameter.Classes in net.sourceforge.pmd.lang.ast.impl that implement Node Modifier and Type Class Description classAbstractNode<B extends AbstractNode<B,N>,N extends Node & GenericNode<N>>Base class for implementations of the Node interface whose children are stored in an array.Methods in net.sourceforge.pmd.lang.ast.impl with type parameters of type Node Modifier and Type Method Description <R extends Node>
@Nullable RAbstractNode. firstChild(Class<? extends R> rClass) -
Uses of Node in net.sourceforge.pmd.lang.ast.impl.antlr4
Subinterfaces of Node in net.sourceforge.pmd.lang.ast.impl.antlr4 Modifier and Type Interface Description interfaceAntlrNode<N extends AntlrNode<N>>Base interface for all Antlr-based implementation of the Node interface.Classes in net.sourceforge.pmd.lang.ast.impl.antlr4 that implement Node Modifier and Type Class Description classBaseAntlrErrorNode<N extends AntlrNode<N>>classBaseAntlrInnerNode<N extends AntlrNode<N>>Base class for the inner nodes (corresponds toParserRuleContext).classBaseAntlrNode<A extends BaseAntlrNode.AntlrToPmdParseTreeAdapter<N>,N extends AntlrNode<N>>Base class for an antlr node.classBaseAntlrTerminalNode<N extends AntlrNode<N>>Base class for terminal nodes (they wrap aTerminalNode).Methods in net.sourceforge.pmd.lang.ast.impl.antlr4 that return Node Modifier and Type Method Description protected NodeAntlrGeneratedParserBase. asPmdNode(org.antlr.v4.runtime.RuleContext ctx) -
Uses of Node in net.sourceforge.pmd.lang.ast.impl.javacc
Subinterfaces of Node in net.sourceforge.pmd.lang.ast.impl.javacc Modifier and Type Interface Description interfaceJjtreeNode<N extends JjtreeNode<N>>Base interface for nodes that are produced by a JJTree parser.Classes in net.sourceforge.pmd.lang.ast.impl.javacc that implement Node Modifier and Type Class Description classAbstractJjtreeNode<B extends AbstractJjtreeNode<B,N>,N extends JjtreeNode<N>>Base class for node produced by JJTree.Methods in net.sourceforge.pmd.lang.ast.impl.javacc with parameters of type Node Modifier and Type Method Description intAbstractJjtreeNode. compareLocation(Node other) -
Uses of Node in net.sourceforge.pmd.lang.metrics
Classes in net.sourceforge.pmd.lang.metrics with type parameters of type Node Modifier and Type Interface Description interfaceMetric<N extends Node,R extends Number>A named computation that can be carried out on some nodes.Methods in net.sourceforge.pmd.lang.metrics with type parameters of type Node Modifier and Type Method Description static <N extends Node,R extends Number>
@Nullable RMetric. compute(Metric<N,R> metric, Node node, MetricOptions options)Compute a metric on an arbitrary node, if possible.static <N extends Node,R extends Number>
RMetricsUtil. computeMetric(Metric<? super N,R> key, N node)Computes a metric identified by its code on a node, with the default options.static <N extends Node,R extends Number>
RMetricsUtil. computeMetric(Metric<? super N,R> key, N node, MetricOptions options)Computes a metric identified by its code on a node, possibly selecting a variant with theoptionsparameter.static <N extends Node,R extends Number>
RMetricsUtil. computeMetric(Metric<? super N,R> key, N node, MetricOptions options, boolean forceRecompute)Computes a metric identified by its code on a node, possibly selecting a variant with theoptionsparameter.static <O extends Node>
DoubleSummaryStatisticsMetricsUtil. computeStatistics(Metric<? super O,?> key, Iterable<? extends O> ops)Computes statistics for the results of a metric over a sequence of nodes.static <O extends Node>
DoubleSummaryStatisticsMetricsUtil. computeStatistics(Metric<? super O,?> key, Iterable<? extends O> ops, MetricOptions options)Computes statistics for the results of a metric over a sequence of nodes.static <T extends Node,R extends Number>
Metric<T,R>Metric. of(BiFunction<? super T,MetricOptions,? extends R> compute, Function<? super Node,? extends @Nullable T> cast, @NonNull String fullName, String... aliases)Factory method for a metric.Methods in net.sourceforge.pmd.lang.metrics with parameters of type Node Modifier and Type Method Description @Nullable NMetric. castIfSupported(@NonNull Node node)Casts the node to the more specific type<N>if this metric can be computed on it.static <N extends Node,R extends Number>
@Nullable RMetric. compute(Metric<N,R> metric, Node node, MetricOptions options)Compute a metric on an arbitrary node, if possible.default Map<Metric<?,?>,Number>LanguageMetricsProvider. computeAllMetricsFor(Node node)Computes all metrics available on the given node.default booleanMetric. supports(Node node)Checks if the metric can be computed on the node.static booleanMetricsUtil. supportsAll(Node node, Metric<?,?>... metrics)Method parameters in net.sourceforge.pmd.lang.metrics with type arguments of type Node Modifier and Type Method Description static <T extends Node,R extends Number>
Metric<T,R>Metric. of(BiFunction<? super T,MetricOptions,? extends R> compute, Function<? super Node,? extends @Nullable T> cast, @NonNull String fullName, String... aliases)Factory method for a metric. -
Uses of Node in net.sourceforge.pmd.lang.rule
Methods in net.sourceforge.pmd.lang.rule with parameters of type Node Modifier and Type Method Description voidAbstractVisitorRule. apply(Node target, RuleContext ctx)voidRule. apply(Node target, RuleContext ctx)Process the given node.voidRuleReference. apply(Node target, RuleContext ctx)Method parameters in net.sourceforge.pmd.lang.rule with type arguments of type Node Modifier and Type Method Description static RuleTargetSelectorRuleTargetSelector. forTypes(Class<? extends Node> first, Class<? extends Node>... types)Target nodes that are subtypes of any of the given classes.static RuleTargetSelectorRuleTargetSelector. forTypes(Collection<Class<? extends Node>> types)Target nodes that are subtypes of any of the given classes. -
Uses of Node in net.sourceforge.pmd.lang.rule.impl
Methods in net.sourceforge.pmd.lang.rule.impl with parameters of type Node Modifier and Type Method Description voidUnnecessaryPmdSuppressionRule. apply(Node rootNode, RuleContext ctx) -
Uses of Node in net.sourceforge.pmd.lang.rule.xpath
Subinterfaces of Node in net.sourceforge.pmd.lang.rule.xpath Modifier and Type Interface Description interfaceCommentNodeinterfaceTextNodeMethods in net.sourceforge.pmd.lang.rule.xpath that return Node Modifier and Type Method Description @NonNull NodeAttribute. getParent()Return the node that owns this attribute.Methods in net.sourceforge.pmd.lang.rule.xpath with parameters of type Node Modifier and Type Method Description voidXPathRule. apply(Node target, RuleContext ctx)Constructors in net.sourceforge.pmd.lang.rule.xpath with parameters of type Node Constructor Description Attribute(@NonNull Node parent, @NonNull String name, @NonNull MethodHandle handle, @NonNull Method method)Creates a new attribute belonging to the given node using its accessor.Attribute(@NonNull Node parent, @NonNull String name, @Nullable String value)Creates a new attribute belonging to the given node using its string value. -
Uses of Node in net.sourceforge.pmd.lang.rule.xpath.impl
Methods in net.sourceforge.pmd.lang.rule.xpath.impl with parameters of type Node Modifier and Type Method Description ObjectXPathFunctionDefinition.FunctionCall. call(@Nullable Node contextNode, Object[] arguments)This method is called at runtime to evaluate the XPath function expression.Constructors in net.sourceforge.pmd.lang.rule.xpath.impl with parameters of type Node Constructor Description AttributeAxisIterator(@NonNull Node contextNode)Creates a new iterator that enumerates the attributes of the given node. -
Uses of Node in net.sourceforge.pmd.lang.symboltable
Subinterfaces of Node in net.sourceforge.pmd.lang.symboltable Modifier and Type Interface Description interfaceScopedNodeANodewhich knows about the scope within it has been declared. -
Uses of Node in net.sourceforge.pmd.reporting
Classes in net.sourceforge.pmd.reporting with type parameters of type Node Modifier and Type Class Description classAbstractAnnotationSuppressor<A extends Node>Base class for aViolationSuppressorthat uses annotations of the source language to suppress some warnings.Methods in net.sourceforge.pmd.reporting with parameters of type Node Modifier and Type Method Description voidRuleContext. addViolation(Node location)Record a new violation of the contextual rule, at the given node.voidRuleContext. addViolation(Node location, Object... formatArgs)Record a new violation of the contextual rule, at the given node.voidRuleContext. addViolationWithMessage(Node location, String message)Record a new violation of the contextual rule, at the given node.voidRuleContext. addViolationWithMessage(Node location, String message, Object... formatArgs)Record a new violation of the contextual rule, at the given node.voidRuleContext. addViolationWithPosition(Node node, int beginLine, int endLine, String message, Object... formatArgs)Record a new violation of the contextual rule, at the given node.static Map<String,String>ViolationDecorator. apply(ViolationDecorator decorator, Node violationNode)voidViolationDecorator. decorate(Node violationNode, Map<String,String> additionalInfo)Compute additional key/value pairs about the violation that should be reflected inRuleViolation.getAdditionalInfo().protected abstract NodeStream<A>AbstractAnnotationSuppressor. getAnnotations(Node n)Return the annotations attached to the given node.booleanAbstractAnnotationSuppressor.AnnotationWalkCallbacks. processNode(Node annotationParam, @NonNull String stringValue)Process one parameter of the annotation being walked.Report.SuppressedViolationAbstractAnnotationSuppressor. suppressOrNull(RuleViolation rv, @NonNull Node node)static @Nullable Report.SuppressedViolationViolationSuppressor. suppressOrNull(List<ViolationSuppressor> suppressorList, RuleViolation rv, Node node)Apply a list of suppressors on the violation.@Nullable Report.SuppressedViolationViolationSuppressor. suppressOrNull(RuleViolation rv, @NonNull Node node)Returns aReport.SuppressedViolationif the given violation is suppressed by this object. -
Uses of Node in net.sourceforge.pmd.util.designerbindings
Methods in net.sourceforge.pmd.util.designerbindings that return types with arguments of type Node Modifier and Type Method Description List<Node>RelatedNodesSelector. getHighlightedNodesWhenSelecting(Node node)Returns a list of nodes that should be highlighted when selecting the given node.Methods in net.sourceforge.pmd.util.designerbindings with parameters of type Node Modifier and Type Method Description Collection<DesignerBindings.AdditionalInfo>DesignerBindings.DefaultDesignerBindings. getAdditionalInfo(Node node)Collection<DesignerBindings.AdditionalInfo>DesignerBindings. getAdditionalInfo(Node node)Returns a collection of "additional information" entries pertaining to the given node.List<Node>RelatedNodesSelector. getHighlightedNodesWhenSelecting(Node node)Returns a list of nodes that should be highlighted when selecting the given node.DesignerBindings.TreeIconIdDesignerBindings.DefaultDesignerBindings. getIcon(Node node)DesignerBindings.TreeIconIdDesignerBindings. getIcon(Node node)Returns a constant describing an icon that the node should bear in the treeview and other relevant places.AttributeDesignerBindings.DefaultDesignerBindings. getMainAttribute(Node node)AttributeDesignerBindings. getMainAttribute(Node node)Returns the "main" attribute of the given node.booleanDesignerBindings.DefaultDesignerBindings. isExpandedByDefaultInTree(Node node)booleanDesignerBindings. isExpandedByDefaultInTree(Node node)Returns true if the children of this node should be displayed in the treeview by default. -
Uses of Node in net.sourceforge.pmd.util.treeexport
Methods in net.sourceforge.pmd.util.treeexport with parameters of type Node Modifier and Type Method Description protected voidTextTreeRenderer. appendBoundaryForNodeLn(Node node, Appendable out, String indentStr)protected voidTextTreeRenderer. appendNodeInfoLn(Appendable out, Node node)Append info about the node.voidTextTreeRenderer. renderSubtree(Node node, Appendable out)voidTreeRenderer. renderSubtree(Node node, Appendable out)Appends the subtree rooted at the given node on the provided output writer.voidXmlTreeRenderer. renderSubtree(Node node, Appendable out)Appends the subtree rooted at the given node on the provided output writer.protected booleanXmlTreeRenderer.XmlRenderingConfig. takeAttribute(Node node, Attribute attribute)Returns true if the attribute should be included in the element corresponding to the given node.
-