Package org.neo4j.gds.doc
Class QueryCollectingTreeProcessor
- java.lang.Object
-
- org.asciidoctor.extension.BaseProcessor
-
- org.asciidoctor.extension.Treeprocessor
-
- org.neo4j.gds.doc.QueryCollectingTreeProcessor
-
- All Implemented Interfaces:
org.asciidoctor.extension.Processor
public class QueryCollectingTreeProcessor extends org.asciidoctor.extension.TreeprocessorExtension for Asciidoctor. Think of it as a listener: it is installed in the AsciiDoctor instance and gets pinged once for each file that is processed. It looks for two kinds of blocks in the AsciiDoc source: 1) Blocks with the role `setup-query` or 'graph-project-query' 2) Blocks with the role `query-example`. The content is expected to contain exactly two blocks: 2.1) First, a block containing a Cypher query example. 2.2) Second, a table containing a Cypher query result. Each block may have an attribute 'operator' if we want a certain user to execute the query Once you have calledprocess(org.asciidoctor.ast.Document)you are then able to query this class for the before-all, before-each and actual example queries. Remember though, you should only harvest queries after the last document has been processed, or you will not get the right grouping.
-
-
Constructor Summary
Constructors Constructor Description QueryCollectingTreeProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<DocQuery>getBeforeAllQueries()java.util.List<DocQuery>getBeforeEachQueries()java.util.List<QueryExampleGroup>getQueryExampleGroups()Do grouping into QueryExampleGroupsorg.asciidoctor.ast.Documentprocess(org.asciidoctor.ast.Document document)This method is called once for each file loaded.-
Methods inherited from class org.asciidoctor.extension.BaseProcessor
createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createDocument, createList, createList, createList, createListItem, createListItem, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createSection, createSection, createSection, createSection, createSection, createTable, createTable, createTableCell, createTableCell, createTableCell, createTableCell, createTableColumn, createTableColumn, createTableRow, getConfig, log, parseContent, setConfig, unwrap, updateConfig
-
-
-
-
Method Detail
-
process
public org.asciidoctor.ast.Document process(org.asciidoctor.ast.Document document)
This method is called once for each file loaded. This affects grouping mainly. We collect the three types of queries from each file, and someone can harvest them all later.- Specified by:
processin classorg.asciidoctor.extension.Treeprocessor
-
getBeforeAllQueries
public java.util.List<DocQuery> getBeforeAllQueries()
-
getBeforeEachQueries
public java.util.List<DocQuery> getBeforeEachQueries()
-
getQueryExampleGroups
public java.util.List<QueryExampleGroup> getQueryExampleGroups()
Do grouping into QueryExampleGroups
-
-