nl.flotsam.pecia.builder.base
Class DefaultArticleBuilder<T>

java.lang.Object
  extended by nl.flotsam.pecia.builder.base.AbstractBuilder<T>
      extended by nl.flotsam.pecia.builder.base.DefaultArticleBuilder<T>
All Implemented Interfaces:
AnnotatedArticle<T>, Article<T>, ArticleBuilder<T>, Initializer<AnnotatedArticle<T>>, Contents<Article<T>>, DocumentElement<T>, SimpleContents<Article<T>>
Direct Known Subclasses:
DefaultArticleDocument

public class DefaultArticleBuilder<T>
extends AbstractBuilder<T>
implements ArticleBuilder<T>


Constructor Summary
DefaultArticleBuilder(DocumentBuilder builder, T parent, String title, LifecycleListener listener)
           
 
Method Summary
 Author<AnnotatedArticle<T>> author()
          Adds author metadata to the start of the article.
 AnnotatedArticle<T> copyright(String owner, int... year)
          Adds a copyright notice to the start of the article.
 Article<T> document(Documenter<SimpleContents<?>> target)
          Generates documentation, and returns the current context.
 String getAuthorEmail()
           
 String getAuthorFirstname()
           
 String getAuthorSurname()
           
 String getCopyright()
           
 String getTitle()
           
 ItemizedList<? extends Article<T>> itemizedList()
          Adds an itemized list.
 ItemizedList<? extends Article<T>> orderedList()
          Adds an ordered list.
 Para<? extends Article<T>> para()
          Adds a paragraph.
 Article<T> para(String text)
          Adds a paragraph (Para) containing the text passed in.
 AnnotatedSection<? extends Article<T>> section(String title)
          Adds a new section.
 AnnotatedArticle<T> start()
           
 Table2Cols<? extends Article<T>> table2Cols()
          Adds a two-column table.
 Table3Cols<? extends Article<T>> table3Cols()
          Adds a three-column table.
 Table4Cols<? extends Article<T>> table4Cols()
          Adds a four-column table.
 Table5Cols<? extends Article<T>> table5Cols()
          Adds a five-column table.
 Verbatim<? extends Article<T>> verbatim()
          Adds verbatim content.
 
Methods inherited from class nl.flotsam.pecia.builder.base.AbstractBuilder
end, getBuilder, getListener, getParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.flotsam.pecia.DocumentElement
end, getParent
 

Constructor Detail

DefaultArticleBuilder

public DefaultArticleBuilder(DocumentBuilder builder,
                             T parent,
                             String title,
                             LifecycleListener listener)
Method Detail

itemizedList

public ItemizedList<? extends Article<T>> itemizedList()
Description copied from interface: SimpleContents
Adds an itemized list.

Specified by:
itemizedList in interface SimpleContents<Article<T>>
Returns:
The itemized list just created.

orderedList

public ItemizedList<? extends Article<T>> orderedList()
Description copied from interface: SimpleContents
Adds an ordered list.

Specified by:
orderedList in interface SimpleContents<Article<T>>
Returns:
The ordered list just created.

para

public Para<? extends Article<T>> para()
Description copied from interface: SimpleContents
Adds a paragraph.

Specified by:
para in interface SimpleContents<Article<T>>
Returns:
The paragraph added.

section

public AnnotatedSection<? extends Article<T>> section(String title)
Description copied from interface: Contents
Adds a new section.

Specified by:
section in interface Contents<Article<T>>
Parameters:
title - The title of the section.
Returns:
The section just created.

table2Cols

public Table2Cols<? extends Article<T>> table2Cols()
Description copied from interface: SimpleContents
Adds a two-column table.

Specified by:
table2Cols in interface SimpleContents<Article<T>>
Returns:
A two column table.

table3Cols

public Table3Cols<? extends Article<T>> table3Cols()
Description copied from interface: SimpleContents
Adds a three-column table.

Specified by:
table3Cols in interface SimpleContents<Article<T>>
Returns:
A three column table.

table4Cols

public Table4Cols<? extends Article<T>> table4Cols()
Description copied from interface: SimpleContents
Adds a four-column table.

Specified by:
table4Cols in interface SimpleContents<Article<T>>
Returns:
A four column table.

table5Cols

public Table5Cols<? extends Article<T>> table5Cols()
Description copied from interface: SimpleContents
Adds a five-column table.

Specified by:
table5Cols in interface SimpleContents<Article<T>>
Returns:
A five column table.

verbatim

public Verbatim<? extends Article<T>> verbatim()
Description copied from interface: SimpleContents
Adds verbatim content.

Specified by:
verbatim in interface SimpleContents<Article<T>>
Returns:
The object representing verbatim content.

start

public AnnotatedArticle<T> start()
Specified by:
start in interface Initializer<AnnotatedArticle<T>>

getTitle

public String getTitle()
Specified by:
getTitle in interface ArticleBuilder<T>

copyright

public AnnotatedArticle<T> copyright(String owner,
                                     int... year)
Description copied from interface: AnnotatedArticle
Adds a copyright notice to the start of the article.

Specified by:
copyright in interface AnnotatedArticle<T>
Parameters:
owner - The copyright holder.
year - The copyright year.
Returns:
This context.

getCopyright

public String getCopyright()

author

public Author<AnnotatedArticle<T>> author()
Description copied from interface: AnnotatedArticle
Adds author metadata to the start of the article.

Specified by:
author in interface AnnotatedArticle<T>
Returns:
The Author context, allowing you to add author metadata.

getAuthorEmail

public String getAuthorEmail()
Specified by:
getAuthorEmail in interface ArticleBuilder<T>

getAuthorFirstname

public String getAuthorFirstname()
Specified by:
getAuthorFirstname in interface ArticleBuilder<T>

getAuthorSurname

public String getAuthorSurname()
Specified by:
getAuthorSurname in interface ArticleBuilder<T>

para

public Article<T> para(String text)
Description copied from interface: SimpleContents
Adds a paragraph (Para) containing the text passed in.

Specified by:
para in interface SimpleContents<Article<T>>
Parameters:
text - The text to be added to the paragraph.
Returns:
The current element.

document

public Article<T> document(Documenter<SimpleContents<?>> target)
Description copied from interface: SimpleContents
Generates documentation, and returns the current context.

Specified by:
document in interface SimpleContents<Article<T>>
Parameters:
target - The object generating the documentation.


Copyright © 2010. All Rights Reserved.