Skip to content

Package io.github.sandydunlop.markista.markdown

Class TypeWriter

java.lang.Object
        io.github.sandydunlop.markista.markdown.TypeWriter


public class TypeWriter

A class that outputs API type documentation as Markdown.

Field Summary

Modifier and Type Field Description
private static final String TEXT_CLASS
private static final String TEXT_DESCRIPTION
private static final String TEXT_MODIFIER_AND_TYPE
private static final String BR
private static final String NBSP
private Context ctx The Context singleton instance providing access to the current documentation generation context, including configuration, current module/package/type names, and reporting utilities.
private Writer writer The Writer used to output the generated markdown content for the current document.

Constructor Summary

Constructor Description
TypeWriter(Context context) Constructor that sets up the locations API documents will be written to.

Method Summary

Modifier and Type Method Description
public void outputTypeDoc(TypeNode typeNode) Writes a Markdown file for the Javadoc of a type
private void outputSupertypes(TypeNode typeNode) Outputs the hierarchy of supertypes of a class
private void outputImplementedInterfaces(TypeNode typeNode) Outputs details of any interfaces that this class implements
private void outputEnclosingClass(TypeNode typeNode) Outputs details of the class that encloses this one
private void outputDeclaration(TypeNode typeNode) Outputs the type declaration
private void outputMethodOrFieldDeclaration(AbstractMember member) Outputs the type declaration
private String createAnnotationString(AppliedAnnotationNode annotation) Creates a string of the elements within an annotation
private void outputNestedClassSummary(List<TypeView> nestedClasses) Outputs a summary of nested classes within this one as Markdown
private void outputEnumConstantsSummary(EnumTypeNode enumNode) Outputs as summary of an enum's constants as Markdown
private void outputFieldSummary(List<FieldNode> fields) Outputs a summary of this class's fields as Markdown
private void outputConstructorSummary(List<MethodNode> methods) Outputs a the summary of this class's constructors as Markdown
private void outputMethodSummary(List<MethodNode> methods) Writes the markdown for a class's method summary table
private void outputEnumConstantDetails(List<FieldNode> constants) Outputs enum constant details as Markdown
private void outputDetails(List<Node> nodes) Writes the markdown for a class's method or field details.
private void outputReferences(Node node) Outputs references for a type member
private void outputMethodDetails(MethodNode method) Outputs the Javadoc of a method as Markdown
private void outputMethodParams(MethodNode method) Outputs the parameters of a method as Markdown
private void outputDeprecation(Deprecation status, Text text) Outputs the deprecation status of this type as Markdown

Field Details

TEXT_CLASS

private static final String TEXT_CLASS

See Also:

Constant Field Values


TEXT_DESCRIPTION

private static final String TEXT_DESCRIPTION

See Also:

Constant Field Values


TEXT_MODIFIER_AND_TYPE

private static final String TEXT_MODIFIER_AND_TYPE

See Also:

Constant Field Values


BR

private static final String BR

See Also:

Constant Field Values


NBSP

private static final String NBSP


ctx

private Context ctx

The Context singleton instance providing access to the current documentation generation context, including configuration, current module/package/type names, and reporting utilities.

Warning
Do not make this final. It will break tests with mocked Context.


writer

private Writer writer

The Writer used to output the generated markdown content for the current document. It handles writing text to the appropriate output file or stream.


Method Details

outputTypeDoc

public void outputTypeDoc

Writes a Markdown file for the Javadoc of a type

Throws:

java.nio.file.InvalidPathException , java.io.IOException


outputSupertypes

private void outputSupertypes

Outputs the hierarchy of supertypes of a class

Throws:

java.io.IOException


outputImplementedInterfaces

private void outputImplementedInterfaces

Outputs details of any interfaces that this class implements

Throws:

java.io.IOException


outputEnclosingClass

private void outputEnclosingClass

Outputs details of the class that encloses this one

Throws:

java.io.IOException


outputDeclaration

private void outputDeclaration

Outputs the type declaration

Throws:

java.io.IOException


outputMethodOrFieldDeclaration

private void outputMethodOrFieldDeclaration

Outputs the type declaration

Throws:

java.io.IOException


createAnnotationString

private String createAnnotationString

Creates a string of the elements within an annotation

Returns:

The string


outputNestedClassSummary

private void outputNestedClassSummary

Outputs a summary of nested classes within this one as Markdown

Throws:

java.io.IOException


outputEnumConstantsSummary

private void outputEnumConstantsSummary

Outputs as summary of an enum's constants as Markdown

Throws:

java.io.IOException


outputFieldSummary

private void outputFieldSummary

Outputs a summary of this class's fields as Markdown

Throws:

java.io.IOException


outputConstructorSummary

private void outputConstructorSummary

Outputs a the summary of this class's constructors as Markdown

Throws:

java.io.IOException


outputMethodSummary

private void outputMethodSummary

Writes the markdown for a class's method summary table

Throws:

java.io.IOException


outputEnumConstantDetails

private void outputEnumConstantDetails

Outputs enum constant details as Markdown

Throws:

java.io.IOException


outputDetails

private void outputDetails

Writes the markdown for a class's method or field details.

Throws:

java.io.IOException

Since:

0.1.0

See Also:

http://example.com

java.util.List


outputReferences

private void outputReferences

Outputs references for a type member

Throws:

java.io.IOException


outputMethodDetails

private void outputMethodDetails

Outputs the Javadoc of a method as Markdown

Throws:

java.io.IOException


outputMethodParams

private void outputMethodParams

Outputs the parameters of a method as Markdown

Throws:

java.io.IOException


outputDeprecation

private void outputDeprecation

Outputs the deprecation status of this type as Markdown

Throws:

java.io.IOException