NIHVIVO-1562 Show class of template directive/model in dump. Use LinkedHashMap in help data structure to ensure ordering of the entries.

This commit is contained in:
ryounes 2011-04-22 22:16:28 +00:00
parent b6ea045503
commit 1b9f4bbdce
11 changed files with 37 additions and 25 deletions

View file

@ -54,6 +54,7 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel {
private static final Pattern PROPERTY_NAME_PATTERN = Pattern.compile("^(get|is)\\w");
enum Key {
CLASS("class"),
DATE_TYPE("dateType"),
HELP("help"),
METHODS("methods"),
@ -430,6 +431,7 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel {
private Map<String, Object> getTemplateModelDump(TemplateMethodModel model, String varName) throws TemplateModelException {
Map<String, Object> map = new HashMap<String, Object>();
map.put(Key.TYPE.toString(), Type.METHOD);
map.put(Key.CLASS.toString(), model.getClass().getName());
map.put(Key.HELP.toString(), getHelp(model, varName));
return map;
}
@ -437,6 +439,7 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel {
private Map<String, Object> getTemplateModelDump(TemplateDirectiveModel model, String varName) throws TemplateModelException {
Map<String, Object> map = new HashMap<String, Object>();
map.put(Key.TYPE.toString(), Type.DIRECTIVE);
map.put(Key.CLASS.toString(), model.getClass().getName());
map.put(Key.HELP.toString(), getHelp(model, varName));
return map;
}