public class TemplateProcessing
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NULL_VALUE |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
processTemplate(java.lang.String pattern,
java.util.Map<java.lang.String,java.lang.Object> parameters,
TemplateConfiguration config)
Format given pattern with given parameters and configuration.
|
static java.lang.String |
processTemplate(java.lang.String pattern,
java.lang.Object object,
java.lang.reflect.Executable executable,
java.util.Map<java.lang.String,java.lang.Object> parameters,
TemplateConfiguration config)
Format given pattern with given parameters and configuration.
|
static java.lang.String |
retrieveValue(TemplateConfiguration templateConfig,
int index,
java.lang.String[] fields,
java.lang.Object object)
Example:
fields = {"object", "names", "hash"} from 'template part' = {object.names.hash}
templateConfig - default
|
public static final java.lang.String NULL_VALUE
public static java.lang.String processTemplate(@Nonnull
java.lang.String pattern,
@Nullable
java.lang.Object object,
@Nullable
java.lang.reflect.Executable executable,
@Nullable
java.util.Map<java.lang.String,java.lang.Object> parameters,
@Nonnull
TemplateConfiguration config)
pattern - text patter to formatobject - current object contextexecutable - current execution contextparameters - a map which will be used to locate reference replacements in patternconfig - templating mechanism configurationpublic static java.lang.String processTemplate(@Nonnull
java.lang.String pattern,
@Nullable
java.util.Map<java.lang.String,java.lang.Object> parameters,
@Nonnull
TemplateConfiguration config)
pattern - text patter to formatparameters - a map which will be used to locate reference replacements in patternconfig - templating mechanism configurationpublic static java.lang.String retrieveValue(@Nonnull
TemplateConfiguration templateConfig,
int index,
@Nonnull
java.lang.String[] fields,
@Nullable
java.lang.Object object)
throws java.lang.Throwable
Given:
object - some object
names - the List containing 3 String objects with hashes: {25,32,57}
hash - field, which value should be retrieved
Result: "[25,32,57]"
templateConfig - TemplateConfiguration for result formattingindex - Index of the current field, from the template partfields - Fields of the template partobject - Value of the current fieldString representation of object field(s) value(s).java.lang.NoSuchFieldException - if field not foundjava.lang.Throwable