com.vladsch.flexmark.ast.util.HeadingCollectingVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of driver-cql-shaded Show documentation
Show all versions of driver-cql-shaded Show documentation
A Shaded CQL ActivityType driver for http://nosqlbench.io/
package com.vladsch.flexmark.ast.util;
import com.vladsch.flexmark.ast.Heading;
import com.vladsch.flexmark.util.ast.BlockNodeVisitor;
import com.vladsch.flexmark.util.ast.Node;
import com.vladsch.flexmark.util.ast.NodeVisitor;
import com.vladsch.flexmark.util.ast.VisitHandler;
import java.util.ArrayList;
public class HeadingCollectingVisitor {
final private ArrayList headings = new ArrayList<>();
final private NodeVisitor myVisitor;
public HeadingCollectingVisitor() {
myVisitor = new BlockNodeVisitor(
new VisitHandler<>(Heading.class, headings::add)
);
}
public void collect(Node node) {
myVisitor.visit(node);
}
public ArrayList collectAndGetHeadings(Node node) {
myVisitor.visit(node);
return headings;
}
public ArrayList getHeadings() {
return headings;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy