public class AttributeMetacardFormatter extends BaseMetacardFormatter
%[attribute=id]
will be replaced
with the metacard identifier. This formatter will continue to loop over the template until all
tags are replaced. This allows a tag that gets a another template. For example %[attribute=subjectLine]
could return %[attribute=title] (id: %[attribute=id])
, which
will then get expanded. If the metacard attribute returns multiple values, then the values will
be separated with a comma. If the metacard does not return a value, then a default value
(specified in ctor) will be used. The maximum number of iterations is limited to prevent infinite
loops.Constructor and Description |
---|
AttributeMetacardFormatter(String defaultReplacement) |
Modifier and Type | Method and Description |
---|---|
protected String |
doFormat(String template,
WorkspaceMetacardImpl workspaceMetacard,
Long hitCount)
The arguments are guaranteed to be non-null.
|
String |
toString() |
format
public AttributeMetacardFormatter(String defaultReplacement)
defaultReplacement
- must be non-nullprotected String doFormat(String template, WorkspaceMetacardImpl workspaceMetacard, Long hitCount)
BaseMetacardFormatter
doFormat
in class BaseMetacardFormatter
template
- non-nullworkspaceMetacard
- non-nullhitCount
- non-nullThis work is licensed under a Creative Commons Attribution 4.0 International License.