public void destroy() { }
/* Create a new Message object if the message can be decoded */
@Override
public AsciidocMessage decode(String string) throws DecodeException {
AsciidocMessage msg = null;
if (willDecode(string)) {
msg = new AsciidocMessage(messageMap.get("writer"), messageMap.get("source"));
if (messageMap.get("part") != null)
msg.setPart(messageMap.get("part"));
switch (messageMap.get("type")) {
case "adoc-for-html5":
msg.setAction("backendHtml5");
break;
case "adoc-for-pdf":
msg.setAction("backendPDF");
break;
case "adoc-for-dzslides":
msg.setAction("backendDzSlides");
break;
case "adoc-for-diff":
msg.setAdocSourceToMerge(messageMap.get("sourceToMerge"));
msg.setAction("diff");
break;
case "adoc-for-patch":
msg.setPatchToApply(messageMap.get("patch"));
msg.setAction("patch");
break;
}
} else {
logger.severe(string);
throw new DecodeException(string, "[Message] Can't decode.");