mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
remove methods
This commit is contained in:
parent
e67434c8cc
commit
449fe1fa2e
@ -18,6 +18,7 @@ package org.dromara.hutool.json;
|
||||
|
||||
import org.dromara.hutool.core.lang.getter.TypeGetter;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.json.support.InternalJSONUtil;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
@ -25,6 +25,7 @@ import org.dromara.hutool.core.map.MapUtil;
|
||||
import org.dromara.hutool.core.map.MapWrapper;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.json.support.InternalJSONUtil;
|
||||
import org.dromara.hutool.json.writer.JSONWriter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -19,6 +19,7 @@ package org.dromara.hutool.json.reader;
|
||||
import org.dromara.hutool.core.lang.mutable.MutableEntry;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.json.*;
|
||||
import org.dromara.hutool.json.support.InternalJSONUtil;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
@ -23,7 +23,7 @@ import org.dromara.hutool.core.lang.copier.Copier;
|
||||
import org.dromara.hutool.core.reflect.ConstructorUtil;
|
||||
import org.dromara.hutool.core.reflect.TypeUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.json.InternalJSONUtil;
|
||||
import org.dromara.hutool.json.support.InternalJSONUtil;
|
||||
import org.dromara.hutool.json.JSON;
|
||||
import org.dromara.hutool.json.JSONConfig;
|
||||
import org.dromara.hutool.json.JSONObject;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hutool.json;
|
||||
package org.dromara.hutool.json.support;
|
||||
|
||||
import org.dromara.hutool.core.bean.copier.CopyOptions;
|
||||
import org.dromara.hutool.core.codec.binary.HexUtil;
|
||||
@ -24,6 +24,9 @@ import org.dromara.hutool.core.map.CaseInsensitiveTreeMap;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.json.JSON;
|
||||
import org.dromara.hutool.json.JSONConfig;
|
||||
import org.dromara.hutool.json.JSONFactory;
|
||||
import org.dromara.hutool.json.serializer.JSONMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -120,32 +123,6 @@ public final class InternalJSONUtil {
|
||||
.setConverter((targetType, value) -> mapper.toJSON(value, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 对所有双引号做转义处理(使用双反斜杠做转义)<br>
|
||||
* 为了能在HTML中较好的显示,会将</转义为<\/<br>
|
||||
* JSON字符串中不能包含控制字符和未经转义的引号和反斜杠
|
||||
*
|
||||
* @param string 字符串
|
||||
* @return 适合在JSON中显示的字符串
|
||||
*/
|
||||
public static String quote(final CharSequence string) {
|
||||
return quote(string, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对所有双引号做转义处理(使用双反斜杠做转义)<br>
|
||||
* 为了能在HTML中较好的显示,会将</转义为<\/<br>
|
||||
* JSON字符串中不能包含控制字符和未经转义的引号和反斜杠
|
||||
*
|
||||
* @param string 字符串
|
||||
* @param isWrap 是否使用双引号包装字符串
|
||||
* @return 适合在JSON中显示的字符串
|
||||
* @since 3.3.1
|
||||
*/
|
||||
public static String quote(final CharSequence string, final boolean isWrap) {
|
||||
return quote(string, new StringBuilder(), isWrap).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对所有双引号做转义处理(使用双反斜杠做转义)<br>
|
||||
* 为了能在HTML中较好的显示,会将</转义为<\/<br>
|
||||
@ -207,7 +184,7 @@ public final class InternalJSONUtil {
|
||||
* @param factory JSON工厂,{@code null}则使用默认配置
|
||||
* @return Map
|
||||
*/
|
||||
static Map<String, JSON> createRawMap(final int capacity, final JSONFactory factory) {
|
||||
public static Map<String, JSON> createRawMap(final int capacity, final JSONFactory factory) {
|
||||
final JSONConfig config = ObjUtil.apply(factory, JSONFactory::getConfig);
|
||||
final boolean ignoreCase = ObjUtil.defaultIfNull(config, JSONConfig::isIgnoreCase, false);
|
||||
final Comparator<String> keyComparator = ObjUtil.apply(config, JSONConfig::getKeyComparator);
|
@ -23,7 +23,7 @@ import org.dromara.hutool.core.regex.ReUtil;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.util.ObjUtil;
|
||||
import org.dromara.hutool.json.InternalJSONUtil;
|
||||
import org.dromara.hutool.json.support.InternalJSONUtil;
|
||||
import org.dromara.hutool.json.JSON;
|
||||
import org.dromara.hutool.json.JSONConfig;
|
||||
import org.dromara.hutool.json.JSONException;
|
||||
@ -232,7 +232,8 @@ public class JSONWriter implements Appendable, Flushable, Closeable {
|
||||
}
|
||||
// 换行缩进
|
||||
writeLF().writeSpace(indent);
|
||||
return writeRaw(InternalJSONUtil.quote(key));
|
||||
writeQuoteStrValue(key);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,7 +20,7 @@ import org.dromara.hutool.core.lang.mutable.MutableEntry;
|
||||
import org.dromara.hutool.core.text.CharUtil;
|
||||
import org.dromara.hutool.core.text.StrUtil;
|
||||
import org.dromara.hutool.core.xml.XmlConstants;
|
||||
import org.dromara.hutool.json.InternalJSONUtil;
|
||||
import org.dromara.hutool.json.support.InternalJSONUtil;
|
||||
import org.dromara.hutool.json.JSONException;
|
||||
import org.dromara.hutool.json.JSONObject;
|
||||
import org.dromara.hutool.json.JSONUtil;
|
||||
|
Loading…
x
Reference in New Issue
Block a user