Attribute implements Serializable, Cloneable { public static Attribute createTemplateAttribute(String template) { Attribute attribute = new Attribute(); attribute.setValue(template); attribute.setRenderer(TEMPLATE_RENDERER); return attribute; } Attribute();  Attribute(Object value);  Attribute(Attribute attribute);  Attribute(Object value, String role);  Attribute(Object value, Expression expression, String role, String rendererName); static Attribute createTemplateAttribute(String template); static Attribute createTemplateAttribute(String template,
            String templateExpression, String templateType, String role); static Attribute createTemplateAttributeWithExpression(
            String templateExpression); String getRole(); Set<String> getRoles(); void setRole(String role); void setRoles(Set<String> roles); Object getValue(); void setValue(Object value); Expression getExpressionObject(); void setExpressionObject(Expression expressionObject); @Override String toString(); String getRenderer(); void setRenderer(String rendererName); void inherit(Attribute attribute); @Override boolean equals(Object obj); boolean isPermitted(Request request); @Override int hashCode(); @Override Attribute clone();  }
@Test public void testCreateTemplateAttribute() { Attribute attribute = Attribute.createTemplateAttribute("myTemplate", "MYLANG:myExpression", "myType", "myRole"); assertEquals("myTemplate", attribute.getValue()); assertEquals("MYLANG", attribute.getExpressionObject().getLanguage()); assertEquals("myExpression", attribute.getExpressionObject().getExpression()); assertEquals("myType", attribute.getRenderer()); Set<String> roles = attribute.getRoles(); assertEquals(1, roles.size()); assertTrue(roles.contains("myRole")); }