-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56439dc
commit 5f2da8f
Showing
5 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...-module/src/main/java/org/asciidoctor/maven/site/parser/processors/NoOpNodeProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.asciidoctor.maven.site.parser.processors; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.maven.doxia.sink.Sink; | ||
import org.asciidoctor.ast.StructuralNode; | ||
import org.asciidoctor.maven.site.parser.AsciidoctorAstDoxiaParser; | ||
import org.asciidoctor.maven.site.parser.NodeProcessor; | ||
import org.asciidoctor.maven.site.parser.NodeSinker; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Fallback NodeProcessor to collect nodes that have not dedicated processor. | ||
*/ | ||
public class NoOpNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { | ||
|
||
private final org.slf4j.Logger logger = LoggerFactory.getLogger(AsciidoctorAstDoxiaParser.class); | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param sink Doxia {@link Sink} | ||
* @param nodeSinker | ||
*/ | ||
public NoOpNodeProcessor(Sink sink, NodeSinker nodeSinker) { | ||
super(sink, nodeSinker); | ||
} | ||
|
||
@Override | ||
public boolean applies(StructuralNode node) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void process(StructuralNode node) { | ||
final List<StructuralNode> blocks = node.getBlocks(); | ||
|
||
logger.warn("Fallback behaviour for node: {}", node.getNodeName()); | ||
if (!blocks.isEmpty()) { | ||
blocks.forEach(this::sink); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters