public class SimpleDataSource extends AbstractDataSource
Modifier and Type | Class and Description |
---|---|
protected class |
SimpleDataSource.ActionDescriptor
Field actions are used to execute context related actions.
|
protected class |
SimpleDataSource.ValueDescriptor
Value assigned to a keyword.
|
FIELD_FILLIN, FIELD_MERGEFIELD
Constructor and Description |
---|
SimpleDataSource()
Creates a new field listener.
|
SimpleDataSource(boolean caseSensitiveKeywords)
Creates a new field listener.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionWrapListItem(java.lang.String keyword,
Node wrapper)
Adds an action that wraps the list-item of current list into
another node.
|
void |
addActionWrapTableRow(java.lang.String keyword,
Node wrapper)
Adds an action that wraps the table row of current cell into
another node.
|
SimpleDataSource.ValueDescriptor |
getValue(java.lang.String keyword) |
boolean |
hasValue(java.lang.String keyword)
Checks whether a value is assigned to a keyword.
|
protected boolean |
insertResult(FieldContext ctx,
java.lang.String keyword)
Inserts the result for a field depending of type of data.
|
boolean |
isCloneIfNeccessary()
Checks if special objects in field result should be cloned or not
if they are inserted multiple times.
|
boolean |
isEmptyValue(java.lang.String keyword)
Checks whether an empty value is assigned to a keyword.
|
java.util.List |
listActions(java.lang.String keyword)
Lists all actions assigned to a keyword.
|
void |
removeActions(java.lang.String keyword)
Removes all actions that are assigned to keyword.
|
void |
removeValue(java.lang.String keyword)
Removes a value.
|
void |
setCloneIfNeccessary(boolean cloneIfNeccessary)
If a value (result) of a field is inserted multiple times and it contains
some
NodeElement Objects (e.g. fo:inline, fo:block) then these
node elements should be cloned. |
void |
setDocument(java.lang.String keyword,
Document document,
boolean restartPageNumbering)
Sets a whole document as a value for a field.
|
void |
setDocumentContent(java.lang.String keyword,
Document document)
Sets a the content of a document as fields value.
|
void |
setEmptyValue(java.lang.String keyword)
Sets an empty value for a field.
|
void |
setListItems(java.lang.String keyword,
java.lang.Object[] items)
Sets items for a list or numbering.
|
void |
setTableColumn(java.lang.String keyword,
java.lang.Object[] cells)
Sets cells for a table column.
|
void |
setValue(java.lang.String keyword,
java.lang.Object value)
Sets the value for a field.
|
fieldEncountered, handleUnpopulatedField, isCaseSensitiveKeywords, isEnableDateFormatting, isEnableNumberFormatting, isHighlightUnpopulatedFields, normalizeKey, setCaseSensitiveKeywords, setEnableDateFormatting, setEnableNumberFormatting, setHighlightUnpopulatedFields
public SimpleDataSource()
public SimpleDataSource(boolean caseSensitiveKeywords)
caseSensitiveKeywords
- true
to handle keywords
of fields (prompt of fill-in or field name of mergefield) casesensitive.public void setValue(java.lang.String keyword, java.lang.Object value)
keyword
- Keyword of field.value
- Value of field.public void setEmptyValue(java.lang.String keyword)
keyword
- Keyword of field.public void setTableColumn(java.lang.String keyword, java.lang.Object[] cells)
keyword
- Keyword of fieldcells
- Cells of table column.public void setListItems(java.lang.String keyword, java.lang.Object[] items)
keyword
- Keyword of field.items
- Items for numbering.public boolean hasValue(java.lang.String keyword)
hasValue
in class AbstractDataSource
keyword
- Keyword.true
if there is a registered value for keyword.public boolean isEmptyValue(java.lang.String keyword)
AbstractDataSource
isEmptyValue
in class AbstractDataSource
keyword
- Keywordtrue
if value of keyword is empty.public void setCloneIfNeccessary(boolean cloneIfNeccessary)
NodeElement
Objects (e.g. fo:inline, fo:block) then these
node elements should be cloned. By default cloning is enabled (set to true).cloneIfNeccessary
- Clone objects if neccessary.public boolean isCloneIfNeccessary()
public void setDocument(java.lang.String keyword, Document document, boolean restartPageNumbering)
keyword
- Keyword of field.document
- The document you want to insert.restartPageNumbering
- true
if you want to restart page numbering.public void setDocumentContent(java.lang.String keyword, Document document)
keyword
- Keyword of field.document
- Document.public void addActionWrapTableRow(java.lang.String keyword, Node wrapper)
keyword
- Keyword of field.wrapper
- Wrapper.public void addActionWrapListItem(java.lang.String keyword, Node wrapper)
keyword
- Keyword of field.wrapper
- Wrapper.public void removeActions(java.lang.String keyword)
keyword
- Keyword of a field.public java.util.List listActions(java.lang.String keyword)
keyword
- Keyword of a field.public SimpleDataSource.ValueDescriptor getValue(java.lang.String keyword)
public void removeValue(java.lang.String keyword)
keyword
- Keywords.protected boolean insertResult(FieldContext ctx, java.lang.String keyword)
insertResult
in class AbstractDataSource
ctx
- FieldContext.keyword
- Keyword of field© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.