public abstract class DocumentPartFormatter<T> extends Object
Provides the functionality for formatting a part of a document.
T
: The type of a document's part.
Modifier | Constructor and Description |
---|---|
protected |
DocumentPartFormatter()
Initializes a new instance of the
DocumentPartFormatter class. |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
formatText(T item,
DocumentPartOptions documentPartOptions)
Converts
item to the string with formatting. |
protected DocumentPartOptions |
getPreviousDocumentPartOptions()
Gets the previous formatted options.
|
protected T |
getPreviousItem()
Gets the previous formatted item.
|
String |
getText(T item)
Converts
item to the string with formatting. |
String |
getText(T item,
DocumentPartOptions documentPartOptions)
Converts
item to the string with formatting. |
boolean |
isEmpty()
Gets a value indicating whether the formatter is empty.
|
protected boolean |
isFirstItem()
Gets a value indicating whether formatter has the previous formatted item.
|
void |
reset()
Resets the previous formatted item.
|
protected DocumentPartFormatter()
Initializes a new instance of the DocumentPartFormatter
class.
public boolean isEmpty()
Gets a value indicating whether the formatter is empty.
protected T getPreviousItem()
Gets the previous formatted item.
protected DocumentPartOptions getPreviousDocumentPartOptions()
Gets the previous formatted options.
protected boolean isFirstItem()
Gets a value indicating whether formatter has the previous formatted item.
public void reset()
Resets the previous formatted item.
public String getText(T item, DocumentPartOptions documentPartOptions)
Converts item
to the string with formatting.
item
- The item for formatting.documentPartOptions
- The options for formatting.item
.public String getText(T item)
Converts item
to the string with formatting.
item
- The item for formatting.item
.protected abstract String formatText(T item, DocumentPartOptions documentPartOptions)
Converts item
to the string with formatting.
item
- The item for formatting.documentPartOptions
- The options for formatting.item
.Copyright © 2019. All rights reserved.