public class MessageRenderer extends Object
Message5WH object.| Modifier and Type | Field and Description |
|---|---|
static STGroup |
DEFAULT_STG
The default STGroup for messages read from
DEFAULT_STG_FN. |
static String |
DEFAULT_STG_FN
The file name of the default STGroup file.
|
protected STGroup |
stg
The ST group for the message
|
static Map<String,Set<String>> |
STG_CHUNKS
The STGroup chunks for validation of an STGroup for a message.
|
| Constructor and Description |
|---|
MessageRenderer()
Returns a new renderer with the default STGroup.
|
MessageRenderer(STGroup stg)
Returns a new renderer with the given STGroup.
|
MessageRenderer(String filename)
Returns a new renderer with the STGroup read from the given file name (file system or as resource).
|
| Modifier and Type | Method and Description |
|---|---|
String |
render(Collection<Message5WH> messages)
Renders a collection of messages.
|
String |
render(Message5WH msg)
Renders a single message
|
protected void |
validateSTG()
Validates the local STGroup
|
protected STGroup stg
public static String DEFAULT_STG_FN
public static STGroup DEFAULT_STG
DEFAULT_STG_FN.public MessageRenderer()
public MessageRenderer(STGroup stg)
stg - given STGroup for the rendererIllegalArgumentException - if the given STGroup was null or not validpublic MessageRenderer(String filename)
filename - file to read STGroup fromIllegalArgumentException - if the given file name or STGroup was null or not validprotected void validateSTG()
IllegalArgumentException - if the local STGroup was null or not validpublic String render(Message5WH msg)
msg - message to renderpublic String render(Collection<Message5WH> messages)
messages - the collection of messages to renderCopyright © 2010–2017. All rights reserved.