Skip to content

Writing your own formatting classes

David Grierson edited this page Sep 23, 2020 · 1 revision

Formatting classes can now be authored by you in order to generate release notes which contain the information appropriate to your organisation's needs.

Formatting classes should be derived from the Generator abstract class located within the net.sigmalab.maven.plugin.jira.formats package. This abstract class has the following structure:

Constructors

The following constructor MUST be defined in your inherited class for your class to be instantiated by the plugin:

public Generator(JiraRestClient client, Iterable<Issue> issues, String beforeText, String afterText);

Inheritable Fields

The following fields can be accessed from within your inherited class.

protected IssueRestClient issueClient;

Concrete Methods within the Generator class

The following method is called by the plugin upon the instantiated Generator object -- you may choose to override this.

public void output(PrintWriter ps);

Abstract Methods

The following methods are abstract within the Generator class and must be overridden. You may choose to not implement any method bodies within these and simply return an empty String.

public abstract String addHeader();
public abstract String addHorizontalRule();
public abstract String addTableHeader();
public abstract String addRow(Issue i);
public abstract String addTableFooter();
public abstract String addBeforeText();
public abstract String addAfterText();
public abstract String addFooter();

The Generator.output(PrintWriter ps) method uses these methods - if you wish to override the default structure - e.g. to add your own release note components, you can do this by also overriding this method.