org.hyphenType.documentation.lib
Class StandardFormatterEngine<T extends Options<?>>

java.lang.Object
  extended by org.hyphenType.documentation.DocumentationFormatterEngine<T,StandardFormatterEngine.StandardFormatter>
      extended by org.hyphenType.documentation.lib.StandardFormatterEngine<T>
Type Parameters:
T -

public class StandardFormatterEngine<T extends Options<?>>
extends DocumentationFormatterEngine<T,StandardFormatterEngine.StandardFormatter>

A documentation formatter inspired on the standard Unix way to show documentation in the command line. This documentation is typically invoked in Unix-like systems using --help or -h.

Author:
Aurelio Akira M. Matsui

Nested Class Summary
static interface StandardFormatterEngine.StandardFormatter
          Annotation to configure the StandardFormatterEngine.
 
Constructor Summary
StandardFormatterEngine()
           
 
Method Summary
 String print(String title, String description, int titleIndent, int descriptionIndent, int maxColumn, boolean lineBreakAtSpace)
          Generates a string that contains the textual representation of a title and a message, formatting using a certain indent and a maximum column.
 void printDocumentation(PrintStream pw, LexerParser<T> lexPar, StandardFormatterEngine.StandardFormatter annotation)
           
 
Methods inherited from class org.hyphenType.documentation.DocumentationFormatterEngine
buildFormatter, getAnnotation, getMessage, getOptionsInterfaceValue, getOptionsInterfaceValue, getStatusCodeUserDescription, preferredFormatter, printDocumentation, printDocumentation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardFormatterEngine

public StandardFormatterEngine()
Method Detail

printDocumentation

public final void printDocumentation(PrintStream pw,
                                     LexerParser<T> lexPar,
                                     StandardFormatterEngine.StandardFormatter annotation)
Specified by:
printDocumentation in class DocumentationFormatterEngine<T extends Options<?>,StandardFormatterEngine.StandardFormatter>
Parameters:
pw - TODO
lexPar - TODO
annotation - TODO

print

public final String print(String title,
                          String description,
                          int titleIndent,
                          int descriptionIndent,
                          int maxColumn,
                          boolean lineBreakAtSpace)
Generates a string that contains the textual representation of a title and a message, formatting using a certain indent and a maximum column. Format is as follows (hyphens are used to represent white spaces):
 --Title-------Text-text-text
 --------------text-more-text
 --------------and-even-more-
 --------------text.
 

Parameters:
title - The title of the group of lines.
description - The description that accompanies the title.
titleIndent - The indent of the title, in characters, relative to the left margin.
descriptionIndent - The indent of the description, in characters, relative to the left margin.
maxColumn - The maximum column to print characters.
lineBreakAtSpace - Whether lines should break always at a space character (creating a dented effect), or at any character (making the block look like a rectangle).
Returns:
A string representation of the title and description, formatted according with descriptionIndent, maxColumn, and lineBreakAtSpace.


Copyright © 2013. All Rights Reserved.