All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.chilldev.commons.text.formatter.PlainTextFormatter Maven / Gradle / Ivy

There is a newer version: 0.4.4
Show newest version
/**
 * This file is part of the ChillDev-Commons.
 *
 * @license http://mit-license.org/ The MIT license
 * @copyright 2016 - 2017 © by Rafał Wrzeszcz - Wrzasq.pl.
 */

package pl.chilldev.commons.text.formatter;

import org.apache.commons.text.StringEscapeUtils;

/**
 * Plain text format handler.
 */
public class PlainTextFormatter implements FormatterInterface
{
    /**
     * {@inheritDoc}
     */
    @Override
    public String transform(String text)
    {
        return StringEscapeUtils.ESCAPE_XML10.translate(text).replaceAll("\n", "
"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy