From 69bf8f8bf239b00d4aa392368c4cfcba719bd715 Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Mon, 22 Jan 2024 19:42:47 +0100 Subject: [PATCH] Improve JavaDocs to reduce warnings during CI & release --- .../maven/commons/StringUtils.java | 15 ++++++++++ .../AsciidoctorJExtensionRegistry.java | 16 +++++++++- .../maven/http/AsciidoctorHandler.java | 8 ++++- .../maven/http/AsciidoctorHttpServer.java | 23 +++++++++++++-- .../site/ast/AsciidoctorAstDoxiaParser.java | 8 ++++- .../ast/AsciidoctorAstDoxiaParserModule.java | 1 + .../maven/site/ast/NodeProcessor.java | 3 ++ .../maven/site/ast/NodesSinker.java | 29 ++++++++++++++++--- .../processors/AbstractSinkNodeProcessor.java | 16 ++++++++++ .../ast/processors/DocumentNodeProcessor.java | 11 +++++++ .../ast/processors/ImageNodeProcessor.java | 8 +++++ .../ast/processors/ListItemNodeProcessor.java | 16 ++++++++++ .../ast/processors/ListingNodeProcessor.java | 8 +++++ .../ast/processors/LiteralNodeProcessor.java | 11 +++++++ .../processors/OrderedListNodeProcessor.java | 20 +++++++++++-- .../processors/ParagraphNodeProcessor.java | 11 +++++++ .../ast/processors/PreambleNodeProcessor.java | 11 +++++++ .../ast/processors/SectionNodeProcessor.java | 14 ++++++++- .../ast/processors/TableNodeProcessor.java | 12 ++++++++ .../UnorderedListNodeProcessor.java | 20 +++++++++++-- 20 files changed, 247 insertions(+), 14 deletions(-) diff --git a/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/StringUtils.java b/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/StringUtils.java index 3f6d003d..6893223c 100644 --- a/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/StringUtils.java +++ b/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/StringUtils.java @@ -7,6 +7,15 @@ */ public class StringUtils { + private StringUtils() { + } + + /** + * Whether a {@link CharSequence} it blank (null, empty or white characters). + * + * @param cs character sequence + * @return {@literal true} if input is blank + */ public static boolean isBlank(final CharSequence cs) { int strLen; if (cs != null && (strLen = cs.length()) != 0) { @@ -19,6 +28,12 @@ public static boolean isBlank(final CharSequence cs) { return true; } + /** + * Whether a {@link CharSequence} it not blank (null, empty or white characters). + * + * @param cs character sequence + * @return {@literal true} if input is not blank + */ public static boolean isNotBlank(final CharSequence cs) { return !isBlank(cs); } diff --git a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/extensions/AsciidoctorJExtensionRegistry.java b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/extensions/AsciidoctorJExtensionRegistry.java index c454a091..ea488fa7 100644 --- a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/extensions/AsciidoctorJExtensionRegistry.java +++ b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/extensions/AsciidoctorJExtensionRegistry.java @@ -1,7 +1,16 @@ package org.asciidoctor.maven.extensions; import org.asciidoctor.Asciidoctor; -import org.asciidoctor.extension.*; +import org.asciidoctor.extension.BlockMacroProcessor; +import org.asciidoctor.extension.BlockProcessor; +import org.asciidoctor.extension.DocinfoProcessor; +import org.asciidoctor.extension.IncludeProcessor; +import org.asciidoctor.extension.InlineMacroProcessor; +import org.asciidoctor.extension.JavaExtensionRegistry; +import org.asciidoctor.extension.Postprocessor; +import org.asciidoctor.extension.Preprocessor; +import org.asciidoctor.extension.Processor; +import org.asciidoctor.extension.Treeprocessor; /** * Class responsible for registering extensions. @@ -12,6 +21,11 @@ public class AsciidoctorJExtensionRegistry implements ExtensionRegistry { private JavaExtensionRegistry javaExtensionRegistry; + /** + * Constructor. + * + * @param asciidoctorInstance Asciidoctor instance + */ public AsciidoctorJExtensionRegistry(Asciidoctor asciidoctorInstance) { javaExtensionRegistry = asciidoctorInstance.javaExtensionRegistry(); } diff --git a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHandler.java b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHandler.java index c7d3d96d..2fdc2e5d 100644 --- a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHandler.java +++ b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHandler.java @@ -5,7 +5,13 @@ import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; -import io.netty.handler.codec.http.*; +import io.netty.handler.codec.http.DefaultFullHttpResponse; +import io.netty.handler.codec.http.FullHttpRequest; +import io.netty.handler.codec.http.HttpHeaderNames; +import io.netty.handler.codec.http.HttpHeaders; +import io.netty.handler.codec.http.HttpMethod; +import io.netty.handler.codec.http.HttpResponseStatus; +import io.netty.handler.codec.http.HttpVersion; import io.netty.util.CharsetUtil; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; diff --git a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHttpServer.java b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHttpServer.java index 4c347883..8acc09d7 100644 --- a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHttpServer.java +++ b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/http/AsciidoctorHttpServer.java @@ -18,6 +18,9 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; +/** + * HTTP server to expose AsciiDoc converted sources. + */ public class AsciidoctorHttpServer { private static final String HOST = "localhost"; @@ -32,13 +35,26 @@ public class AsciidoctorHttpServer { private ServerBootstrap bootstrap; private NioEventLoopGroup workerGroup; - public AsciidoctorHttpServer(final Log logger, final int port, final File outputDirectory, final String defaultPage) { + /** + * Constructor. + * + * @param logger server logger + * @param port server port + * @param workingDirectory sources location + * @param defaultPage default page used for root (aka. index) + */ + public AsciidoctorHttpServer(final Log logger, final int port, final File workingDirectory, final String defaultPage) { this.logger = logger; this.port = port; - this.workDir = outputDirectory; + this.workDir = workingDirectory; this.defaultPage = defaultPage; } + /** + * Start server. + * + * @return server instance + */ public AsciidoctorHttpServer start() { final AtomicInteger threadId = new AtomicInteger(1); workerGroup = new NioEventLoopGroup(THREAD_NUMBER, runnable -> { @@ -85,6 +101,9 @@ protected void initChannel(final SocketChannel ch) { return this; } + /** + * Stop server. + */ public void stop() { Future shutdownGracefully = workerGroup.shutdownGracefully(); logger.info("Server stopping..."); diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java index 7bb4ae01..6be27d69 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java @@ -5,7 +5,12 @@ import org.apache.maven.doxia.parser.Parser; import org.apache.maven.doxia.sink.Sink; import org.apache.maven.project.MavenProject; -import org.asciidoctor.*; +import org.asciidoctor.Asciidoctor; +import org.asciidoctor.Attributes; +import org.asciidoctor.AttributesBuilder; +import org.asciidoctor.Options; +import org.asciidoctor.OptionsBuilder; +import org.asciidoctor.SafeMode; import org.asciidoctor.ast.Document; import org.asciidoctor.maven.log.LogHandler; import org.asciidoctor.maven.log.LogRecordFormatter; @@ -33,6 +38,7 @@ * (see maven-site-plugin). * * @author abelsromero + * @since 3.0.0 */ @Component(role = Parser.class, hint = AsciidoctorAstDoxiaParser.ROLE_HINT) public class AsciidoctorAstDoxiaParser extends AbstractTextParser { diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParserModule.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParserModule.java index 3e821f23..9c92e415 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParserModule.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParserModule.java @@ -11,6 +11,7 @@ * Doxia provided modules. * * @author abelsromero + * @since 3.0.0 */ @Component(role = ParserModule.class, hint = AsciidoctorAstDoxiaParser.ROLE_HINT) public class AsciidoctorAstDoxiaParserModule extends AbstractParserModule { diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodeProcessor.java index 50e3938e..69a08a8d 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodeProcessor.java @@ -10,6 +10,7 @@ * a specific Node type (but can be accommodated to convert multiples). * * @author abelsromero + * @since 3.0.0 */ public interface NodeProcessor { @@ -17,6 +18,7 @@ public interface NodeProcessor { * Whether the processor can process the node. * * @param node candidate node to process + * @return {@literal true} if the node can be processed */ boolean applies(StructuralNode node); @@ -24,6 +26,7 @@ public interface NodeProcessor { * Whether sub-nodes should be processed recursively. * * @param node candidate node to process + * @return {@literal true} if the node is terminal */ default boolean isTerminal(StructuralNode node) { return false; diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodesSinker.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodesSinker.java index 2c7c70f4..50601ee6 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodesSinker.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/NodesSinker.java @@ -1,24 +1,40 @@ package org.asciidoctor.maven.site.ast; -import org.apache.maven.doxia.sink.Sink; -import org.asciidoctor.ast.StructuralNode; -import org.asciidoctor.maven.site.ast.processors.*; - import java.util.Arrays; import java.util.List; import java.util.Optional; +import org.apache.maven.doxia.sink.Sink; +import org.asciidoctor.ast.StructuralNode; +import org.asciidoctor.maven.site.ast.processors.DocumentNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.ImageNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.ListItemNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.ListingNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.LiteralNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.OrderedListNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.ParagraphNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.PreambleNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.SectionNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.TableNodeProcessor; +import org.asciidoctor.maven.site.ast.processors.UnorderedListNodeProcessor; + /** * Document processor. * Responsible for initializing the different Node Processors * and traverse the AST. * * @author abelsromero + * @since 3.0.0 */ public class NodesSinker { private final List nodeProcessors; + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public NodesSinker(Sink sink) { UnorderedListNodeProcessor unorderedListNodeProcessor = new UnorderedListNodeProcessor(sink); @@ -43,6 +59,11 @@ public NodesSinker(Sink sink) { ); } + /** + * Processes an Asciidoctor AST node. + * + * @param node Asciidoctor {@link StructuralNode} + */ public void processNode(StructuralNode node) { processNode(node, 0); } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java index b49c5ed3..0455063b 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/AbstractSinkNodeProcessor.java @@ -3,14 +3,30 @@ import org.apache.maven.doxia.sink.Sink; import org.asciidoctor.ast.ContentNode; +/** + * Recommended base case to build a {@link org.asciidoctor.maven.site.ast.NodeProcessor}. + * + * @author abelsromero + * @since 3.0.0 + */ public class AbstractSinkNodeProcessor { private final Sink sink; + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public AbstractSinkNodeProcessor(Sink sink) { this.sink = sink; } + /** + * Returns internal {@link Sink}. + * + * @return Doxia {@link Sink} + */ protected Sink getSink() { return sink; } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/DocumentNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/DocumentNodeProcessor.java index a9af8322..3e903362 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/DocumentNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/DocumentNodeProcessor.java @@ -4,8 +4,19 @@ import org.asciidoctor.ast.StructuralNode; import org.asciidoctor.maven.site.ast.NodeProcessor; +/** + * Root document processor. + * + * @author abelsromero + * @since 3.0.0 + */ public class DocumentNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public DocumentNodeProcessor(Sink sink) { super(sink); } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ImageNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ImageNodeProcessor.java index d7689754..05b56a45 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ImageNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ImageNodeProcessor.java @@ -10,9 +10,17 @@ /** * Inline images are processed as paragraphs. + * + * @author abelsromero + * @since 3.0.0 */ public class ImageNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public ImageNodeProcessor(Sink sink) { super(sink); } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListItemNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListItemNodeProcessor.java index c30b1079..f3a5ce89 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListItemNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListItemNodeProcessor.java @@ -7,15 +7,31 @@ import java.util.List; +/** + * List items processor, including numbered and unnumbered. + * + * @author abelsromero + * @since 3.0.0 + */ public class ListItemNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { private List nodeProcessors; + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public ListItemNodeProcessor(Sink sink) { super(sink); } + /** + * Inject a list of {@link NodeProcessor}. + * + * @param nodeProcessors {@link List} of {@link NodeProcessor} + */ public void setNodeProcessors(List nodeProcessors) { this.nodeProcessors = nodeProcessors; } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListingNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListingNodeProcessor.java index da5f9a1e..f537ab97 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListingNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ListingNodeProcessor.java @@ -10,6 +10,9 @@ /** * Processes code blocks. * Create a block compatible with maven-fluido-skin's use code-prettify. + * + * @author abelsromero + * @since 3.0.0 */ public class ListingNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { @@ -19,6 +22,11 @@ public class ListingNodeProcessor extends AbstractSinkNodeProcessor implements N private final ListItemNodeProcessor itemNodeProcessor; + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public ListingNodeProcessor(Sink sink) { super(sink); this.itemNodeProcessor = new ListItemNodeProcessor(sink); diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/LiteralNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/LiteralNodeProcessor.java index 02770adc..10ff2c3b 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/LiteralNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/LiteralNodeProcessor.java @@ -5,10 +5,21 @@ import org.asciidoctor.jruby.ast.impl.BlockImpl; import org.asciidoctor.maven.site.ast.NodeProcessor; +/** + * Literal (aka. monospace) text processor. + * + * @author abelsromero + * @since 3.0.0 + */ public class LiteralNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { private final ListItemNodeProcessor itemNodeProcessor; + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public LiteralNodeProcessor(Sink sink) { super(sink); this.itemNodeProcessor = new ListItemNodeProcessor(sink); diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/OrderedListNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/OrderedListNodeProcessor.java index f483c2a9..1bed4dc7 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/OrderedListNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/OrderedListNodeProcessor.java @@ -6,16 +6,32 @@ import java.util.List; +/** + * Ordered list processor. + * + * @author abelsromero + * @since 3.0.0 + */ public class OrderedListNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { private ListItemNodeProcessor itemNodeProcessor; + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public OrderedListNodeProcessor(Sink sink) { super(sink); } - public void setItemNodeProcessor(ListItemNodeProcessor itemNodeProcessor) { - this.itemNodeProcessor = itemNodeProcessor; + /** + * Inject a {@link ListItemNodeProcessor}. + * + * @param nodeProcessor {@link ListItemNodeProcessor} + */ + public void setItemNodeProcessor(ListItemNodeProcessor nodeProcessor) { + this.itemNodeProcessor = nodeProcessor; } @Override diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ParagraphNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ParagraphNodeProcessor.java index 64a5648a..e50d1ccf 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ParagraphNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/ParagraphNodeProcessor.java @@ -4,8 +4,19 @@ import org.asciidoctor.ast.StructuralNode; import org.asciidoctor.maven.site.ast.NodeProcessor; +/** + * Paragraph processor. + * + * @author abelsromero + * @since 3.0.0 + */ public class ParagraphNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public ParagraphNodeProcessor(Sink sink) { super(sink); } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/PreambleNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/PreambleNodeProcessor.java index d8bfeb6c..423819c0 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/PreambleNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/PreambleNodeProcessor.java @@ -4,8 +4,19 @@ import org.asciidoctor.ast.StructuralNode; import org.asciidoctor.maven.site.ast.NodeProcessor; +/** + * Document preamble processor. + * + * @author abelsromero + * @since 3.0.0 + */ public class PreambleNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public PreambleNodeProcessor(Sink sink) { super(sink); } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/SectionNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/SectionNodeProcessor.java index 80e06fb8..1d8dd7de 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/SectionNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/SectionNodeProcessor.java @@ -6,8 +6,20 @@ import org.asciidoctor.jruby.ast.impl.SectionImpl; import org.asciidoctor.maven.site.ast.NodeProcessor; +/** + * Section title processor. + * Supports 'sectnum' and 'sectnum' attributes. + * + * @author abelsromero + * @since 3.0.0 + */ public class SectionNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public SectionNodeProcessor(Sink sink) { super(sink); } @@ -75,7 +87,7 @@ private String formatTitle(String title, Section node) { } private Long getSectnumlevels(Section node) { - Object sectnumlevels = node.getDocument().getAttribute("sectnumlevels"); + Object sectnumlevels = node.getDocument().getAttribute("sectnum"); if (sectnumlevels != null) { // Injecting from Maven configuration diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/TableNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/TableNodeProcessor.java index 2b9a6ba6..b10019a0 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/TableNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/TableNodeProcessor.java @@ -13,8 +13,20 @@ import static org.asciidoctor.maven.commons.StringUtils.isBlank; import static org.asciidoctor.maven.commons.StringUtils.isNotBlank; +/** + * Table processor. + * Supports 'table-caption' attribute. + * + * @author abelsromero + * @since 3.0.0 + */ public class TableNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public TableNodeProcessor(Sink sink) { super(sink); } diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/UnorderedListNodeProcessor.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/UnorderedListNodeProcessor.java index 95e253e4..12228d81 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/UnorderedListNodeProcessor.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/processors/UnorderedListNodeProcessor.java @@ -6,16 +6,32 @@ import java.util.List; +/** + * Unordered list processor. + * + * @author abelsromero + * @since 3.0.0 + */ public class UnorderedListNodeProcessor extends AbstractSinkNodeProcessor implements NodeProcessor { private ListItemNodeProcessor itemNodeProcessor; + /** + * Constructor. + * + * @param sink Doxia {@link Sink} + */ public UnorderedListNodeProcessor(Sink sink) { super(sink); } - public void setItemNodeProcessor(ListItemNodeProcessor itemNodeProcessor) { - this.itemNodeProcessor = itemNodeProcessor; + /** + * Inject a {@link ListItemNodeProcessor}. + * + * @param nodeProcessor {@link ListItemNodeProcessor} + */ + public void setItemNodeProcessor(ListItemNodeProcessor nodeProcessor) { + this.itemNodeProcessor = nodeProcessor; } @Override