A doclet to output javadoc as an XML document.

Overview

xml-doclet

This library provides a doclet to output the javadoc comments from Java source code to an XML document.
Works with Java 11 and above, supporting up to Java 17 (handling Records and Sealed classes as normal classes).

Build Status

Usage

If you are using Maven you can use this doclet by adding the following configuration to your pom.xml:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-javadoc-plugin</artifactId>
  <configuration>
    <doclet>com.automation.xmldoclet.XmlDoclet</doclet>
    <additionalparam>
        -d ${project.build.directory}
        -filename ${project.artifactId}-${project.version}-javadoc.xml
    </additionalparam>
    <useStandardDocletOptions>false</useStandardDocletOptions>
    <docletArtifact>
      <groupId>com.automation</groupId>
      <artifactId>xml-doclet</artifactId>
      <version>2.0.0</version>
    </docletArtifact>
  </configuration>
</plugin>

If you are not using maven, you can use the jar-with-dependencies, which contains all required libraries.

javadoc -doclet com.automation.xmldoclet.XmlDoclet \
  -docletpath xml-doclet-2.0.0-jar-with-dependencies.jar \
  [Javadoc- and XmlDoclet-Options]

Options

-d <directory>            Destination directory for output file.
                          Default: .

-docencoding <encoding>   Encoding of the output file.
                          Default: UTF8

-dryrun                   Parse javadoc, but don't write output file.
                          Default: false

-filename <filename>      Name of the output file.
                          Default: javadoc.xml

Output

Gives a Java class like this:

package com.example;

/**
 * Worlds greeter.
 */
public class HelloWorld {

    /**
     * Greets all worlds.
     *
     * @param worlds list of worlds to greet
     * @return       a greeting to everyone!
     */
    public String hello(List<String> worlds) {
        return "Hello " + worlds.toString();
    }
}

The doclet will generate the following XML document:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
  <package name="com.example">
    <class name="AnnotatedParameter" qualified="com.example.HelloWorld" scope="public" abstract="false" error="false" exception="false" externalizable="false" included="true" serializable="false">
      <comment>Worlds greeter.</comment>
      <class qualified="java.lang.Object"/>
      <constructor name="AnnotatedParameter" signature="()" qualified="com.example.HelloWorld" scope="public" final="false" included="true" native="false" synchronized="false" static="false" varArgs="false"/>
      <method name="hello" signature="(java.util.List&lt;java.lang.String&gt;)" qualified="com.example.HelloWorld.hello" scope="public" abstract="false" final="false" included="true" native="false" synchronized="false" static="false" varArgs="false">
        <comment>Greets all worlds.</comment>
        <tag name="@param" text="worlds list of worlds to greet"/>
        <tag name="@return" text="a greeting to everyone!"/>
        <parameter name="worlds">
          <type qualified="java.util.List">
            <generic qualified="java.lang.String"/>
          </type>
        </parameter>
        <return qualified="java.lang.String"/>
      </method>
    </class>
  </package>
</root>

Credits

Some ideas and name came from Seth Call: (xml-doclet).
Reimplemented by MarkusBernhardt: (xml-doclet).
Ported to the new Javadoc API for Java 11+ by vojtechhabarta: (xml-doclet).
And now maintained by CloudBlue.

License

Copyright 2018, MarkusBernhardt
Copyright 2020, vojtechhabarta
Copyright 2022, CloudBlue

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...

🎯 ConsoleCaptor captures console output for unit testing purposes

ConsoleCaptor Install library with: Install with maven dependency groupIdio.github.hakky54/groupId artifactIdconsolecaptor/artifactId

Dec 9, 2022

A query language for JSON and a template engine to generate text output.

Josson & Jossons Josson is a query language for JSON. Jossons is a template engine to generate text output. Features and Capabilities of Josson Query

Dec 14, 2022

Output Keycloak Events and Admin Events to a Kafka topic.

keycloak-kafka-eventlistener Output Keycloak Events and Admin Events to a Kafka topic. Based on Keycloak 15.0.2+ / RH-SSO 7.5.0+ How to use the plugin

Oct 10, 2022

eXist Native XML Database and Application Platform

eXist Native XML Database and Application Platform

eXist-db Native XML Database eXist-db is a high-performance open source native XML database—a NoSQL document database and application platform built e

Dec 30, 2022

Java XML library. A really cool one. Obviously.

XMLBeam This is a Java XML library with an extraordinary expressive API. By using XPath for read and write operations, many operations take only one l

Aug 25, 2022

XML/XHTML and CSS 2.1 renderer in pure Java

Flying Saucer OVERVIEW Flying Saucer is a pure-Java library for rendering arbitrary well-formed XML (or XHTML) using CSS 2.1 for layout and formatting

Jan 2, 2023

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJO to JSON in a declarative way.

MapNeat is a JVM library written in Kotlin that provides an easy to use DSL (Domain Specific Language) for transforming JSON to JSON, XML to JSON, POJ

Sep 17, 2022

Nokogiri (鋸) is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support.

Nokogiri Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for reading, writ

Jan 8, 2023

A low intrusive, configurable android library that converts layout XML files into Java code to improve performance

qxml English 一个低侵入,可配置的 Android 库,用于将 layout xml 文件转换为 Java 代码以提高性能。 与X2C的对比 X2C: 使用注解处理器生成View类,使用时需要在类中添加注解,并替换setContentView方法,侵入性较强; 对于布局属性的支持不够完美

Oct 6, 2022

A compiler built in Java that allows to translate xml format to json.

A compiler built in Java that allows to translate xml format to json. Getting Started Welcome to the VS Code Java world. Here is a guideline to help y

Jan 6, 2022

Framework for serialization to Json, XML, Byte and Excel, therefore an oviparous wool milk sow J

Framework for serialization to Json, XML, Byte and Excel, therefore an oviparous wool milk sow J

NetworkParser Framework for serialization from Java objects to Json, XML and Byte. NetworkParser is a simple framework for serializing complex model s

Nov 18, 2020

SitemapGen4j is a library to generate XML sitemaps in Java.

sitemapgen4j SitemapGen4j is a library to generate XML sitemaps in Java. What's an XML sitemap? Quoting from sitemaps.org: Sitemaps are an easy way fo

Dec 16, 2022

Uber-project for (some) standard Jackson textual format backends: csv, properties, yaml (xml to be added in future)

Overview This is a multi-module umbrella project for Jackson standard text-format dataformat backends. Dataformat backends are used to support format

Dec 22, 2022

Core Java Library + PDF/A, xtra and XML Worker

iText 5 is EOL, and has been replaced by iText 7. Only security fixes will be added Known Security Issues org.apache.santuario:xmlsec vul

Jan 9, 2023

A Parser tool which actually tries to convert XML data into JSON data

A Parser tool which actually tries to convert XML data into JSON data

SpringBoot A Parser tool which actually tries to convert XML data into JSON data Tools Required Postman (Testing API's) IDE - Eclipse / NetBeans/ Inte

Jan 27, 2022

Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml

manifest-guard Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml The problem being solved Every third-par

Dec 24, 2022

This project demonstrates usage of Captcha, OTP APIs to access Offline eKYC XML.

Client Application to simulate offline eKYC wrapper API flow Introduction This is a Spring boot application which can be used to download offline eKYC

Oct 29, 2021
Owner
CloudBlue
We power :zap: your speed to market and revenue for traditional and digital products. CloudBlue :blue_heart: Open Source.
CloudBlue
An extensible Java framework for building XML and non-XML streaming applications

Smooks Framework This is the Git source code repository for the Smooks Project. Build Status Building Pre-requisites JDK 8 Apache Maven 3.2.x Maven gi

Smooks Framework 353 Dec 1, 2022
Challenge of JavaIsland: Javadoc

ByteLegend Challenge of JavaIsland: Javadoc English Fix Broken Javadoc Why We Create Such a Challenge Javadoc is corner stone of documentations in Jav

null 2 Jul 14, 2022
documents4j is a Java library for converting documents into another document format

documents4j is a Java library for converting documents into another document format. This is achieved by delegating the conversion to any

documents4j 455 Dec 23, 2022
MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text.

MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text.

null 900 Jan 2, 2023
Document scanner with border detection, perspective correction and custom crop/resize

react-native-document-scanner Preview iOS Android Both Platform Use version >=1.4.1 if you are using react-native 0.48+ $ yarn add https://github.com/

Augusto Pinheiro 53 Nov 10, 2022
Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.

Description Jansi is a small java library that allows you to use ANSI escape codes to format your console output which works even on Windows. It also

FuseSource 955 Dec 28, 2022
Turn -XX:+TraceBytecodes output into a FlameGraph compatible stack format

A tool to turn the output of -XX:+TraceBytecodes (a JDK debug-only feature to print every bytecode executed by the interpreter) into a simple stack fo

Claes Redestad 34 Dec 11, 2022
JVM Profiler Sending Metrics to Kafka, Console Output or Custom Reporter

Uber JVM Profiler Uber JVM Profiler provides a Java Agent to collect various metrics and stacktraces for Hadoop/Spark JVM processes in a distributed w

Uber Common 1.7k Dec 22, 2022
Inspect pmap -X output of a java process, requires Java11, likely not 100% accurate

java-pmap-inspector Inspect pmap -X output of a java process, requires Java 11, likely not 100% accurate. Usage examples $ pmap -X pid > pmap.txt; jav

Brice Dutheil 7 Jul 6, 2022