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

com.denimgroup.threadfix.util.StringUtils Maven / Gradle / Ivy

package com.denimgroup.threadfix.util;

import net.htmlparser.jericho.Renderer;
import net.htmlparser.jericho.Source;


public class StringUtils {

    public static Source getSource(String inputString){
        return new Source(inputString);
    }

    public static String getRenderedString(String inputString, Integer lineBreakLength){
        if(lineBreakLength == null){
            lineBreakLength = 0;
        }
        if(inputString == null || inputString.isEmpty()){
            return "";
        }
        Source source = getSource(inputString);
        if(source == null || source.getAllTags() == null || source.getAllTags().isEmpty()){
            return inputString;
        }

        return getRenderer(source).setMaxLineLength(lineBreakLength).toString();
    }

    public static Renderer getRenderer(Source source){
        return new Renderer(source);
    }

    public static boolean isNullOrEmpty(String inputString){
        return inputString == null || inputString.isEmpty();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy