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

java.lang.Object
  extended by nl.flotsam.pecia.builder.base.AbstractBuilder<T>
      extended by nl.flotsam.pecia.builder.base.DefaultParaBuilder<T>
All Implemented Interfaces:
Initializer<ParaBuilder<T>>, ParaBuilder<T>, DocumentElement<T>, Para<T>, ParaContents<T>
Direct Known Subclasses:
HtmlDocumentBuilder.HtmlParaBuilder

public class DefaultParaBuilder<T>
extends AbstractBuilder<T>
implements ParaBuilder<T>


Constructor Summary
DefaultParaBuilder(DocumentBuilder builder, T parent, LifecycleListener listener)
           
 
Method Summary
 Para<T> code(String text)
          Adds some code to the paragraph.
 Para<T> document(Documenter<ParaContents<?>> target)
          Generates documentation, and returns the current context.
 Para<T> email(String email)
          Inserts an email address.
 Para<T> emphasis(String text)
          Adds an inline emphasized section.
 Footnote<? extends Para<T>> footnote()
          Inserts a footnote.
 Para<T> footnote(String text)
          Inserts a footnote, containing a Para containing the text passed in.
 Para<T> link(Object id, String text)
          Constructs a link to the documet item identified by the specified id.
 ParaBuilder<T> start()
           
 Para<T> term(Object id, String text)
          Inserts a term into the content.
 Para<T> text(String text)
          Appends some text to the paragraph.
 Para<T> xref(String id)
          Inserts a cross reference to another document element.
 
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

DefaultParaBuilder

public DefaultParaBuilder(DocumentBuilder builder,
                          T parent,
                          LifecycleListener listener)
Method Detail

code

public Para<T> code(String text)
Description copied from interface: ParaContents
Adds some code to the paragraph. (Processing expectation: monospaced, 'code'-like rendering.)

Specified by:
code in interface ParaContents<T>
Parameters:
text - The text to be produced as code.
Returns:
The same parent element as the one on which this operation is invoked.

email

public Para<T> email(String email)
Description copied from interface: ParaContents
Inserts an email address.

Specified by:
email in interface ParaContents<T>
Parameters:
email - The email address.
Returns:
The paragraph in which the email address is inserted.

emphasis

public Para<T> emphasis(String text)
Description copied from interface: ParaContents
Adds an inline emphasized section.

Specified by:
emphasis in interface ParaContents<T>
Parameters:
text - The text to be emphasized.
Returns:
The same parent element as the one on which this operation is invoked.

footnote

public Footnote<? extends Para<T>> footnote()
Description copied from interface: ParaContents
Inserts a footnote.

Specified by:
footnote in interface ParaContents<T>
Returns:
The footnote inserted.

text

public Para<T> text(String text)
Description copied from interface: ParaContents
Appends some text to the paragraph.

Specified by:
text in interface ParaContents<T>
Parameters:
text - The text to be appended to the paragraph.
Returns:
The same parent element as the one on which this operation is invoked.

xref

public Para<T> xref(String id)
Description copied from interface: ParaContents
Inserts a cross reference to another document element.

Specified by:
xref in interface ParaContents<T>
Parameters:
id - The identifier of the element to which you are referring.
Returns:
The paragraph in which the email address is inserted.

start

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

link

public Para<T> link(Object id,
                    String text)
Description copied from interface: ParaContents
Constructs a link to the documet item identified by the specified id.

Specified by:
link in interface ParaContents<T>
Parameters:
id - The identifier of the document element referenced.
text - The text to be included in the link.
Returns:
The parent element of the link.

term

public Para<T> term(Object id,
                    String text)
Description copied from interface: ParaContents
Inserts a term into the content.

Specified by:
term in interface ParaContents<T>
Parameters:
id - The object identifying this term.
text - The term itself.

footnote

public Para<T> footnote(String text)
Description copied from interface: ParaContents
Inserts a footnote, containing a Para containing the text passed in.

Specified by:
footnote in interface ParaContents<T>
Parameters:
text - The text in the paragraph added to the footnote.

document

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

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


Copyright © 2010. All Rights Reserved.