Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.0.7
-
None
-
None
-
None
Description
AttributeContext.getLocalAttribute usage is to verbose. I think AttributeContext should be improved. This is my currently using BaseViewPreparer.
public abstract class BaseViewPreparer implements ViewPreparer { @SuppressWarnings("unchecked") protected <T> T getLocalAttribute(String name, AttributeContext attributeContext, T defaultValue){ Attribute attribute = attributeContext.getLocalAttribute(name); if (attribute != null){ return (T) attribute.getValue(); }else{ return defaultValue; } } @Override public abstract void execute(Request tilesContext, AttributeContext attributeContext); }