Example usage for com.liferay.portal.kernel.util StringPool RETURN

List of usage examples for com.liferay.portal.kernel.util StringPool RETURN

Introduction

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

Prototype

String RETURN

To view the source code for com.liferay.portal.kernel.util StringPool RETURN.

Click Source Link

Usage

From source file:au.com.permeance.liferay.portlet.patchingtoolinfo.util.StringHelper.java

License:Open Source License

/** 
 * Strips end of line markers from a List of String lines.
 * // w  w  w  . ja v  a 2  s  .  c  om
 * @param list input List of String lines
 * @return List of trimmed String lines
 */
public static List<String> stripEolFromStringLineList(List<String> lines) {

    List<String> newLines = new ArrayList<String>();

    if (lines != null) {
        for (String line : lines) {
            String str = line;
            str = str.replace(StringPool.NEW_LINE, StringPool.BLANK);
            str = str.replace(StringPool.RETURN, StringPool.BLANK);
            String newLine = str;
            newLines.add(newLine);
        }
    }

    return newLines;
}

From source file:com.liferay.portlet.wiki.translators.BaseTranslator.java

License:Open Source License

private String _normalizeLineBreaks(String content) {
    content = StringUtil.replace(content, new String[] { StringPool.RETURN_NEW_LINE, StringPool.RETURN },
            new String[] { StringPool.NEW_LINE, StringPool.NEW_LINE });

    return content;
}

From source file:com.liferay.tools.sourceformatter.BaseSourceProcessor.java

License:Open Source License

protected String format(File file, String fileName, String absolutePath, String content) throws Exception {

    _errorMessagesMap.remove(fileName);/* w w w. j a  va  2 s .  c  om*/

    String newContent = doFormat(file, fileName, absolutePath, content);

    newContent = StringUtil.replace(newContent, StringPool.RETURN, StringPool.BLANK);

    if (content.equals(newContent)) {
        return content;
    }

    return format(file, fileName, absolutePath, newContent);
}

From source file:com.liferay.util.xml.XMLFormatter.java

License:Open Source License

public static String toCompactSafe(String xml) {
    return StringUtil.replace(xml,
            new String[] { StringPool.RETURN_NEW_LINE, StringPool.NEW_LINE, StringPool.RETURN },
            new String[] { "[$NEW_LINE$]", "[$NEW_LINE$]", "[$NEW_LINE$]" });
}