mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix comment
This commit is contained in:
parent
ee9a2f70dd
commit
855ff3e2c6
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* 基于<a href=“https://github.com/vdurmont/emoji-java”>emoji-java</a>的Emoji表情工具类
|
* 基于https://github.com/vdurmont/emoji-java的Emoji表情工具类
|
||||||
*
|
*
|
||||||
* @author looly
|
* @author looly
|
||||||
*
|
*
|
||||||
|
@ -36,6 +36,7 @@ public class MultipartRequestInputStream extends BufferedInputStream {
|
|||||||
* 跳过指定位数的 bytes.
|
* 跳过指定位数的 bytes.
|
||||||
*
|
*
|
||||||
* @param i 跳过的byte数
|
* @param i 跳过的byte数
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
public void skipBytes(int i) throws IOException {
|
public void skipBytes(int i) throws IOException {
|
||||||
long len = super.skip(i);
|
long len = super.skip(i);
|
||||||
|
@ -83,6 +83,7 @@ public class UploadFile {
|
|||||||
*
|
*
|
||||||
* @param destination 目标文件
|
* @param destination 目标文件
|
||||||
* @return 目标文件
|
* @return 目标文件
|
||||||
|
* @throws IOException IO异常
|
||||||
*/
|
*/
|
||||||
public File write(File destination) throws IOException {
|
public File write(File destination) throws IOException {
|
||||||
assertValid();
|
assertValid();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package cn.hutool.http;
|
package cn.hutool.http;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常用Content-Type类型枚举
|
* 常用Content-Type类型枚举
|
||||||
*
|
*
|
||||||
@ -12,18 +12,29 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
*/
|
*/
|
||||||
public enum ContentType {
|
public enum ContentType {
|
||||||
|
|
||||||
/** 标准表单编码,当action为get时候,浏览器用x-www-form-urlencoded的编码方式把form数据转换成一个字串(name1=value1&name2=value2…)*/
|
/**
|
||||||
|
* 标准表单编码,当action为get时候,浏览器用x-www-form-urlencoded的编码方式把form数据转换成一个字串(name1=value1&name2=value2…)
|
||||||
|
*/
|
||||||
FORM_URLENCODED("application/x-www-form-urlencoded"),
|
FORM_URLENCODED("application/x-www-form-urlencoded"),
|
||||||
/** 文件上传编码,浏览器会把整个表单以控件为单位分割,并为每个部分加上Content-Disposition,并加上分割符(boundary) */
|
/**
|
||||||
|
* 文件上传编码,浏览器会把整个表单以控件为单位分割,并为每个部分加上Content-Disposition,并加上分割符(boundary)
|
||||||
|
*/
|
||||||
MULTIPART("multipart/form-data"),
|
MULTIPART("multipart/form-data"),
|
||||||
/** Rest请求JSON编码 */
|
/**
|
||||||
|
* Rest请求JSON编码
|
||||||
|
*/
|
||||||
JSON("application/json"),
|
JSON("application/json"),
|
||||||
/** Rest请求XML编码 */
|
/**
|
||||||
|
* Rest请求XML编码
|
||||||
|
*/
|
||||||
XML("application/xml"),
|
XML("application/xml"),
|
||||||
/** Rest请求text/xml编码 */
|
/**
|
||||||
|
* Rest请求text/xml编码
|
||||||
|
*/
|
||||||
TEXT_XML("text/xml");
|
TEXT_XML("text/xml");
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
ContentType(String value) {
|
ContentType(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
@ -35,6 +46,7 @@ public enum ContentType {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 输出Content-Type字符串,附带编码信息
|
* 输出Content-Type字符串,附带编码信息
|
||||||
|
*
|
||||||
* @param charset 编码
|
* @param charset 编码
|
||||||
* @return Content-Type字符串
|
* @return Content-Type字符串
|
||||||
*/
|
*/
|
||||||
|
@ -261,6 +261,7 @@ public class HttpRequest extends HttpBase<HttpRequest> {
|
|||||||
* 设置URL
|
* 设置URL
|
||||||
*
|
*
|
||||||
* @param url url字符串
|
* @param url url字符串
|
||||||
|
* @return this
|
||||||
* @since 4.1.8
|
* @since 4.1.8
|
||||||
*/
|
*/
|
||||||
public HttpRequest setUrl(String url) {
|
public HttpRequest setUrl(String url) {
|
||||||
@ -278,6 +279,7 @@ public class HttpRequest extends HttpBase<HttpRequest> {
|
|||||||
* 相关issue见:https://gitee.com/loolly/hutool/issues/IMD1X
|
* 相关issue见:https://gitee.com/loolly/hutool/issues/IMD1X
|
||||||
*
|
*
|
||||||
* @param urlHandler {@link URLStreamHandler}
|
* @param urlHandler {@link URLStreamHandler}
|
||||||
|
* @return this
|
||||||
* @since 4.1.9
|
* @since 4.1.9
|
||||||
*/
|
*/
|
||||||
public HttpRequest setUrlHandler(URLStreamHandler urlHandler) {
|
public HttpRequest setUrlHandler(URLStreamHandler urlHandler) {
|
||||||
|
@ -55,6 +55,7 @@ public class Browser extends UserAgentInfo {
|
|||||||
*
|
*
|
||||||
* @param name 浏览器名称
|
* @param name 浏览器名称
|
||||||
* @param regex 关键字或表达式
|
* @param regex 关键字或表达式
|
||||||
|
* @param versionRegex 匹配版本的正则
|
||||||
*/
|
*/
|
||||||
public Browser(String name, String regex, String versionRegex) {
|
public Browser(String name, String regex, String versionRegex) {
|
||||||
super(name, regex);
|
super(name, regex);
|
||||||
|
@ -546,7 +546,7 @@ public class ExcelUtil {
|
|||||||
* 将Sheet列号变为列名
|
* 将Sheet列号变为列名
|
||||||
*
|
*
|
||||||
* @param index 列号, 从0开始
|
* @param index 列号, 从0开始
|
||||||
* @return 0->A; 1->B...26->AA
|
* @return 0-》A; 1-》B...26-》AA
|
||||||
* @since 4.1.20
|
* @since 4.1.20
|
||||||
*/
|
*/
|
||||||
public static String indexToColName(int index) {
|
public static String indexToColName(int index) {
|
||||||
@ -569,7 +569,7 @@ public class ExcelUtil {
|
|||||||
* 根据表元的列名转换为列号
|
* 根据表元的列名转换为列号
|
||||||
*
|
*
|
||||||
* @param colName 列名, 从A开始
|
* @param colName 列名, 从A开始
|
||||||
* @return A1->0; B1->1...AA1->26
|
* @return A1-》0; B1-》1...AA1-》26
|
||||||
* @since 4.1.20
|
* @since 4.1.20
|
||||||
*/
|
*/
|
||||||
public static int colNameToIndex(String colName) {
|
public static int colNameToIndex(String colName) {
|
||||||
|
@ -567,7 +567,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
final DVConstraint constraint = DVConstraint.createExplicitListConstraint(selectList);
|
final DVConstraint constraint = DVConstraint.createExplicitListConstraint(selectList);
|
||||||
|
|
||||||
// 绑定
|
// 绑定
|
||||||
DataValidation dataValidation = null;
|
DataValidation dataValidation;
|
||||||
|
|
||||||
if(this.sheet instanceof XSSFSheet) {
|
if(this.sheet instanceof XSSFSheet) {
|
||||||
final XSSFDataValidationHelper dvHelper = new XSSFDataValidationHelper((XSSFSheet)sheet);
|
final XSSFDataValidationHelper dvHelper = new XSSFDataValidationHelper((XSSFSheet)sheet);
|
||||||
@ -648,7 +648,10 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
* 如果写到单元格中的内容非null,行号自动+1,否则当前行号不变<br>
|
* 如果写到单元格中的内容非null,行号自动+1,否则当前行号不变<br>
|
||||||
* 样式为默认标题样式,可使用{@link #getHeadCellStyle()}方法调用后自定义默认样式
|
* 样式为默认标题样式,可使用{@link #getHeadCellStyle()}方法调用后自定义默认样式
|
||||||
*
|
*
|
||||||
* @param lastColumn 合并到的最后一个列号
|
* @param firstRow 起始行,0开始
|
||||||
|
* @param lastRow 结束行,0开始
|
||||||
|
* @param firstColumn 起始列,0开始
|
||||||
|
* @param lastColumn 结束列,0开始
|
||||||
* @param content 合并单元格后的内容
|
* @param content 合并单元格后的内容
|
||||||
* @param isSetHeaderStyle 是否为合并后的单元格设置默认标题样式
|
* @param isSetHeaderStyle 是否为合并后的单元格设置默认标题样式
|
||||||
* @return this
|
* @return this
|
||||||
@ -748,7 +751,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
map = new TreeMap<>(comparator);
|
map = new TreeMap<>(comparator);
|
||||||
map.putAll((Map) obj);
|
map.putAll((Map) obj);
|
||||||
} else {
|
} else {
|
||||||
map = BeanUtil.beanToMap(obj, new TreeMap<String, Object>(comparator), false, false);
|
map = BeanUtil.beanToMap(obj, new TreeMap<>(comparator), false, false);
|
||||||
}
|
}
|
||||||
writeRow(map, isFirstRow);
|
writeRow(map, isFirstRow);
|
||||||
if (isFirstRow) {
|
if (isFirstRow) {
|
||||||
@ -789,12 +792,12 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
* @see #writeRow(Map, boolean)
|
* @see #writeRow(Map, boolean)
|
||||||
* @since 4.1.5
|
* @since 4.1.5
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({"rawtypes" })
|
||||||
public ExcelWriter writeRow(Object rowBean, boolean isWriteKeyAsHead) {
|
public ExcelWriter writeRow(Object rowBean, boolean isWriteKeyAsHead) {
|
||||||
if (rowBean instanceof Iterable) {
|
if (rowBean instanceof Iterable) {
|
||||||
return writeRow((Iterable<?>) rowBean);
|
return writeRow((Iterable<?>) rowBean);
|
||||||
}
|
}
|
||||||
Map rowMap = null;
|
Map rowMap;
|
||||||
if (rowBean instanceof Map) {
|
if (rowBean instanceof Map) {
|
||||||
if (MapUtil.isNotEmpty(this.headerAlias)) {
|
if (MapUtil.isNotEmpty(this.headerAlias)) {
|
||||||
rowMap = MapUtil.newTreeMap((Map) rowBean, getInitedAliasComparator());
|
rowMap = MapUtil.newTreeMap((Map) rowBean, getInitedAliasComparator());
|
||||||
@ -806,7 +809,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
rowMap = BeanUtil.beanToMap(rowBean, new LinkedHashMap<String, Object>(), false, false);
|
rowMap = BeanUtil.beanToMap(rowBean, new LinkedHashMap<String, Object>(), false, false);
|
||||||
} else {
|
} else {
|
||||||
// 别名存在情况下按照别名的添加顺序排序Bean数据
|
// 别名存在情况下按照别名的添加顺序排序Bean数据
|
||||||
rowMap = BeanUtil.beanToMap(rowBean, new TreeMap<String, Object>(getInitedAliasComparator()), false, false);
|
rowMap = BeanUtil.beanToMap(rowBean, new TreeMap<>(getInitedAliasComparator()), false, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 其它转为字符串默认输出
|
// 其它转为字符串默认输出
|
||||||
@ -894,6 +897,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
* <p>
|
* <p>
|
||||||
* 需要注意的是,共享样式会共享同一个{@link CellStyle},一个单元格样式改变,全部改变。
|
* 需要注意的是,共享样式会共享同一个{@link CellStyle},一个单元格样式改变,全部改变。
|
||||||
*
|
*
|
||||||
|
* @param style 单元格样式
|
||||||
* @param x X坐标,从0计数,即列号
|
* @param x X坐标,从0计数,即列号
|
||||||
* @param y Y坐标,从0计数,即行号
|
* @param y Y坐标,从0计数,即行号
|
||||||
* @return this
|
* @return this
|
||||||
@ -1003,7 +1007,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
|||||||
/**
|
/**
|
||||||
* 为指定的key列表添加标题别名,如果没有定义key的别名,在onlyAlias为false时使用原key
|
* 为指定的key列表添加标题别名,如果没有定义key的别名,在onlyAlias为false时使用原key
|
||||||
*
|
*
|
||||||
* @param keys 键列表
|
* @param rowMap 一行数据
|
||||||
* @return 别名列表
|
* @return 别名列表
|
||||||
*/
|
*/
|
||||||
private Map<?, ?> aliasMap(Map<?, ?> rowMap) {
|
private Map<?, ?> aliasMap(Map<?, ?> rowMap) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user