Added RenderUtils and more tests.
This commit is contained in:
parent
0da0e43aa5
commit
d7659f4052
24 changed files with 148 additions and 89 deletions
|
@ -41,14 +41,6 @@ public class EncodeUrl implements ValueRenderer {
|
|||
*/
|
||||
@Override
|
||||
public String render(Template template, String valueId, String differentiator) {
|
||||
String value;
|
||||
if (template.hasValueId(differentiator)) {
|
||||
value = template.getValue(differentiator);
|
||||
} else if (template.hasAttribute(differentiator)) {
|
||||
value = template.getAttribute(differentiator).toString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
return StringUtils.encodeUrl(value);
|
||||
return StringUtils.encodeUrl(RenderUtils.fetchValue(template, differentiator));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue