diff --git a/APIJSONORM/src/main/java/apijson/StringUtil.java b/APIJSONORM/src/main/java/apijson/StringUtil.java index efe5bee20..fc9552de4 100755 --- a/APIJSONORM/src/main/java/apijson/StringUtil.java +++ b/APIJSONORM/src/main/java/apijson/StringUtil.java @@ -111,11 +111,13 @@ public static String getString(Object[] array, boolean ignoreEmptyItem) { public static String getString(Object[] array, String split) { return getString(array, split, false); } + //CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182 /**获取string,为null则返回"" - * @param array - * @param split - * @param ignoreEmptyItem - * @return + * @param array -the str array given + * @param split -the token used to split + * @param ignoreEmptyItem -whether to ignore empty item or not + * @return {@link #getString(Object[], String, boolean)} + *
Here we replace the simple "+" way of concatenating with Stringbuilder 's append
*/ public static String getString(Object[] array, String split, boolean ignoreEmptyItem) { StringBuilder s = new StringBuilder(""); @@ -537,10 +539,13 @@ public static String getNumber(CharSequence cs) { public static String getNumber(String s) { return getNumber(s, false); } + + //CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182 /**去掉string内所有非数字类型字符 - * @param s + * @param s -string passed in * @param onlyStart 中间有非数字时只获取前面的数字 - * @return + * @return limit String + *Here we replace the simple "+" way of concatenating with Stringbuilder 's append
*/ public static String getNumber(String s, boolean onlyStart) { if (isNotEmpty(s, true) == false) { @@ -638,10 +643,12 @@ public static String getCorrectEmail(String email) { public static String getPrice(String price) { return getPrice(price, PRICE_FORMAT_DEFAULT); } + //CS304 Issue link: https://github.com/Tencent/APIJSON/issues/182 /**获取价格,保留两位小数 - * @param price + * @param price -price passed in * @param formatType 添加单位(元) - * @return + * @return limit String + *Here we replace the simple "+" way of concatenating with Stringbuilder 's append
*/ public static String getPrice(String price, int formatType) { if (isNotEmpty(price, true) == false) { diff --git a/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java b/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java index 697c145b7..e109b5a04 100755 --- a/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java +++ b/APIJSONORM/src/main/java/apijson/orm/AbstractParser.java @@ -1428,9 +1428,11 @@ public synchronized void putQueryResult(String path, Object result) { queryResultMap.put(path, result); // } } + //CS304 Issue link: https://github.com/Tencent/APIJSON/issues/48 /**根据路径获取值 - * @param valuePath + * @param valuePath -the path need to get value * @return parent == null ? valuePath : parent.get(keys[keys.length - 1]) + *use entrySet+getValue() to replace keySet+get() to enhance efficiency
*/ @Override public Object getValueByPath(String valuePath) { @@ -1445,13 +1447,13 @@ public Object getValueByPath(String valuePath) { } //取出key被valuePath包含的result,再从里面获取key对应的value - Setuse entrySet+getValue() to replace keySet+get() to enhance efficiency
*/ @JSONField(serialize = false) @Override @@ -1539,16 +1541,17 @@ public Object getWhere(String key, boolean exactMatch) { return where == null ? null : where.get(key); } - Setuse entrySet+getValue() to replace keySet+get() to enhance efficiency
*/ @JSONField(serialize = false) public String getSetString(RequestMethod method, Map