= Javadoc Parser
:author: Christian Horz
:icons: font

image:https://github.com/chhorz/javadoc-parser/actions/workflows/maven-ci.yml/badge.svg?branch=master["Java CI", link="https://github.com/chhorz/javadoc-parser/actions/workflows/maven-ci.yml"]
image:https://img.shields.io/maven-central/v/com.github.chhorz/javadoc-parser.svg?logo=apachemaven&label=Maven%20Central["Maven Central", link="https://search.maven.org/artifact/com.github.chhorz/javadoc-parser"]

== About
This library provides a parsing mechanism for *Javadoc* comments within java files.
An initial documentation of the Javadoc tool can be found on the pages of Oracle: link:http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html[Javadoc Tool].

To get the parsing mechanism work properly the Javadoc comment has to follow a specific structure.
The structure should be as close as possible to the link:http://www.oracle.com/technetwork/articles/java/index-137868.html[Writers Guide] from Oracle.

== Usage
The project is available from maven central repository:

[source,xml]
----
<dependency>
  <groupId>com.github.chhorz</groupId>
  <artifactId>javadoc-parser</artifactId>
  <version>${javadoc-parser.version}</version>
</dependency>
----

Information about the latest published version is available on the link:https://github.com/chhorz/javadoc-parser/releases[GitHub Releases] page.

=== Javadoc comment structure
_work in progress_

=== Parser configuration

.Parsing
[source,java]
----
JavaDocParser javaDocParser = JavaDocParserBuilder
		.withStandardJavadocTags()
		.withOutputType(OutputType.PLAIN)
		.build();

JavaDoc javaDoc = javaDocParser.parse("Javadoc as String");
----

=== Retrieving data

.Getting data
[source,java]
----
List<AuthorTag> authorTags = javaDoc.getTags(AuthorTag.class);

AuthorTag firstAuthor = authorTags.get(0);

firstAuthor.getNameText();
----

== Snapshots
Snapshots are available from the Sonatype OSS Snapshots repository.
To configure the repository for your project to use the latest snapshot versions you have to add the following repository to your maven pom:
[source,xml]
----
<repositories>
    <repository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
----

== License
Javadoc Parser is open source software released under the link:http://www.apache.org/licenses/LICENSE-2.0.txt[Apache 2.0 license].
