Example usage for com.liferay.portal.kernel.util EscapableObject EscapableObject

List of usage examples for com.liferay.portal.kernel.util EscapableObject EscapableObject

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util EscapableObject EscapableObject.

Prototype

public EscapableObject(T originalValue, boolean escape) 

Source Link

Usage

From source file:com.liferay.petra.mail.template.internal.DefaultMailTemplateContextBuilder.java

License:Open Source License

@Override
public MailTemplateContextBuilder put(String placeholder, String value) {
    put(placeholder, new EscapableObject<>(value, false));

    return this;
}

From source file:com.liferay.petra.mail.template.internal.DefaultMailTemplateTest.java

License:Open Source License

@Before
public void setUp() {
    MailTemplateContextBuilder mailTemplateContextBuilder = new DefaultMailTemplateContextBuilder();

    mailTemplateContextBuilder.put("[$PLACEHOLDER$]", "replacement");
    mailTemplateContextBuilder.put("[$ESCAPED_VALUE$]", new EscapableObject<>("<>", true));
    mailTemplateContextBuilder.put("[$LOCALIZED_VALUE$]",
            new EscapableLocalizableFunction(Locale::getLanguage));
    mailTemplateContextBuilder.put("[$PORTAL_URL$]", "http://liferay.com");

    _mailTemplateContext = mailTemplateContextBuilder.build();
}