public static String escapeHtml(final String text, final HtmlEscapeType type, final HtmlEscapeLevel level) {

        if (type == null) {
            throw new IllegalArgumentException("The 'type' argument cannot be null");
        }

        if (level == null) {
            throw new IllegalArgumentException("The 'level' argument cannot be null");
        }

        return HtmlEscapeUtil.escape(text, type, level);

    }
public static String escapeHtml ( final String text , final HtmlEscapeType type , final HtmlEscapeLevel level ) { if ( type == null ) { throw new IllegalArgumentException ( "The 'type' argument cannot be null" ) ; } if ( level == null ) { throw new IllegalArgumentException ( "The 'level' argument cannot be null" ) ; } return HtmlEscapeUtil . escape ( text , type , level ) ; }
<p>
Perform a (configurable) HTML <strong>escape</strong> operation on a <tt>String</tt> input.
</p>
<p>
This method will perform an escape operation according to the specified
{@link org.unbescape.html.HtmlEscapeType} and {@link org.unbescape.html.HtmlEscapeLevel}
argument values.
</p>
<p>
All other <tt>String</tt>-based <tt>escapeHtml*(...)</tt> methods call this one with preconfigured
<tt>type</tt> and <tt>level</tt> values.
</p>
<p>
This method is <strong>thread-safe</strong>.
</p>

@param text the <tt>String</tt> to be escaped.
@param type the type of escape operation to be performed, see {@link org.unbescape.html.HtmlEscapeType}.
@param level the escape level to be applied, see {@link org.unbescape.html.HtmlEscapeLevel}.
@return The escaped result <tt>String</tt>. As a memory-performance improvement, will return the exact
same object as the <tt>text</tt> input argument if no escaping modifications were required (and
no additional <tt>String</tt> objects will be created during processing). Will
return <tt>null</tt> if input is <tt>null</tt>.