为什么不推荐使用 org.apache.common.lang3 StringEscapeUtils? [英] Why was org.apache.common.lang3 StringEscapeUtils deprecated?

查看:184
本文介绍了为什么不推荐使用 org.apache.common.lang3 StringEscapeUtils?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到任何解释为什么 StringEscapeUtils 从 Apache Lang3 v3.7 中被弃用.

I couldn't find any explanation why StringEscapeUtils was deprecated from Apache Lang3 v3.7.

https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html

我们现在应该使用什么来进行 HTML 转义/非转义

What are we supposed to use now for HTML escaping/unescaping

推荐答案

该类已从包中移出

org.apache.commons.lang3

org.apache.commons.lang3

org.apache.commons.文本

org.apache.commons.text

您可以轻松替换已弃用的库:

在你的 build.gradle 中:

In your build.gradle:

implementation 'org.apache.commons:commons-text:1.9'

并在使用 StringEscapeUtils 的类中确保导入正确的类:

And in your class using StringEscapeUtils make sure you import the correct class:

import org.apache.commons.text.StringEscapeUtils;

1.9 目前是最新版本(上次检查时间为 2021 年 2 月 24 日),但您可以在 maven 中检查版本:https://mvnrepository.com/artifact/org.apache.commons/commons-text

1.9 is currently the newest version (last checked February 24th 2021) but you can check the versions at maven: https://mvnrepository.com/artifact/org.apache.commons/commons-text

这篇关于为什么不推荐使用 org.apache.common.lang3 StringEscapeUtils?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆