@@ -0,0 +1,1554 @@
+package com.wizzardo.http.framework.template.taglib.g;%0A%0Aimport com.wizzardo.http.framework.di.DependencyFactory;%0Aimport com.wizzardo.http.framework.message.MessageSource;%0Aimport com.wizzardo.http.framework.template.*;%0Aimport com.wizzardo.tools.evaluation.AsBooleanExpression;%0A%0Aimport java.util.Map;%0A%0A/**%0A * Created by wizzardo on 24.05.15.%0A */%0Apublic class FormatBoolean extends Tag %7B%0A%0A    protected MessageSource messageSource = DependencyFactory.getDependency(MessageSource.class);%0A%0A    @Override%0A    public Tag init(Map%3CString, String%3E attrs, Body body, String offset) %7B%0A        ExpressionHolder raw = new ExpressionHolder%3C%3E(remove(attrs, %22boolean%22));%0A%0A        Renderable trueString = getValueString(%22true%22, attrs);%0A        Renderable falseString = getValueString(%22false%22, attrs);%0A%0A        append(offset);%0A        append(model -%3E %7B%0A            Object value = raw.getRaw(model);%0A            if (AsBooleanExpression.toBoolean(value))%0A                return trueString.get(model);%0A            else%0A                return falseString.get(model);%0A        %7D);%0A        append(%22%5Cn%22);%0A        return this;%0A    %7D%0A%0A    protected Renderable getValueString(String name, Map%3CString, String%3E attrs) %7B%0A        String value = attrs.remove(name);%0A        if (value != null)%0A            return new ExpressionHolder%3C%3E(value, true);%0A%0A        value = messageSource.get(%22boolean.%22 + name);%0A        if (value != null)%0A            return Renderable.create(value);%0A%0A        value = messageSource.get(%22default.boolean.%22 + name);%0A        return Renderable.create(value);%0A    %7D%0A%7D%0A

add FormatBoolean tag