Improved the renderers encoding by using the template encoding or encoding specified in a property
This commit is contained in:
parent
538a8d35ae
commit
9738ecb0ba
34 changed files with 197 additions and 61 deletions
|
@ -55,10 +55,13 @@ public class Uptime implements ValueRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
String uptime;
|
||||
if (template.hasAttribute(Uptime.class.getName())) {
|
||||
return RenderUtils.uptime((long) template.getAttribute(Uptime.class.getName()), properties);
|
||||
uptime = RenderUtils.uptime((long) template.getAttribute(Uptime.class.getName()), properties);
|
||||
} else {
|
||||
return RenderUtils.uptime(ManagementFactory.getRuntimeMXBean().getUptime(), properties);
|
||||
uptime = RenderUtils.uptime(ManagementFactory.getRuntimeMXBean().getUptime(), properties);
|
||||
}
|
||||
|
||||
return template.getEncoder().encode(uptime);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue