mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix doc
This commit is contained in:
parent
b811dab681
commit
2602f91327
@ -1,5 +1,13 @@
|
||||
package cn.hutool.captcha;
|
||||
|
||||
import cn.hutool.captcha.generator.CodeGenerator;
|
||||
import cn.hutool.captcha.generator.RandomGenerator;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.img.ImgUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
@ -10,50 +18,59 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import cn.hutool.captcha.generator.CodeGenerator;
|
||||
import cn.hutool.captcha.generator.RandomGenerator;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.img.ImgUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
|
||||
/**
|
||||
* 抽象验证码<br>
|
||||
* 抽象验证码实现了验证码字符串的生成、验证,验证码图片的写出<br>
|
||||
* 实现类通过实现{@link #createImage(String)} 方法生成图片对象
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractCaptcha implements ICaptcha {
|
||||
private static final long serialVersionUID = 3180820918087507254L;
|
||||
|
||||
/** 图片的宽度 */
|
||||
/**
|
||||
* 图片的宽度
|
||||
*/
|
||||
protected int width;
|
||||
/** 图片的高度 */
|
||||
/**
|
||||
* 图片的高度
|
||||
*/
|
||||
protected int height;
|
||||
/** 验证码干扰元素个数 */
|
||||
/**
|
||||
* 验证码干扰元素个数
|
||||
*/
|
||||
protected int interfereCount;
|
||||
/** 字体 */
|
||||
/**
|
||||
* 字体
|
||||
*/
|
||||
protected Font font;
|
||||
/** 验证码 */
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
protected String code;
|
||||
/** 验证码图片 */
|
||||
/**
|
||||
* 验证码图片
|
||||
*/
|
||||
protected byte[] imageBytes;
|
||||
/** 验证码生成器 */
|
||||
/**
|
||||
* 验证码生成器
|
||||
*/
|
||||
protected CodeGenerator generator;
|
||||
/** 背景色 */
|
||||
/**
|
||||
* 背景色
|
||||
*/
|
||||
protected Color background;
|
||||
/** 文字透明度 */
|
||||
/**
|
||||
* 文字透明度
|
||||
*/
|
||||
protected AlphaComposite textAlpha;
|
||||
|
||||
/**
|
||||
* 构造,使用随机验证码生成器生成验证码
|
||||
*
|
||||
* @param width 图片宽
|
||||
* @param height 图片高
|
||||
* @param codeCount 字符个数
|
||||
* @param width 图片宽
|
||||
* @param height 图片高
|
||||
* @param codeCount 字符个数
|
||||
* @param interfereCount 验证码干扰元素个数
|
||||
*/
|
||||
public AbstractCaptcha(int width, int height, int codeCount, int interfereCount) {
|
||||
@ -63,9 +80,9 @@ public abstract class AbstractCaptcha implements ICaptcha {
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
* @param width 图片宽
|
||||
* @param height 图片高
|
||||
* @param generator 验证码生成器
|
||||
* @param width 图片宽
|
||||
* @param height 图片高
|
||||
* @param generator 验证码生成器
|
||||
* @param interfereCount 验证码干扰元素个数
|
||||
*/
|
||||
public AbstractCaptcha(int width, int height, CodeGenerator generator, int interfereCount) {
|
||||
@ -99,12 +116,13 @@ public abstract class AbstractCaptcha implements ICaptcha {
|
||||
* 根据生成的code创建验证码图片
|
||||
*
|
||||
* @param code 验证码
|
||||
* @return Image
|
||||
*/
|
||||
protected abstract Image createImage(String code);
|
||||
|
||||
@Override
|
||||
public String getCode() {
|
||||
if(null == this.code) {
|
||||
if (null == this.code) {
|
||||
createCode();
|
||||
}
|
||||
return this.code;
|
||||
|
@ -415,6 +415,7 @@ public class Scheduler implements Serializable {
|
||||
* 停止定时任务<br>
|
||||
* 此方法调用后会将定时器进程立即结束,如果为守护线程模式,则正在执行的作业也会自动结束,否则作业线程将在执行完成后结束。
|
||||
*
|
||||
* @param clearTasks 是否清除说有任务
|
||||
* @return this
|
||||
* @since 4.1.17
|
||||
*/
|
||||
|
@ -180,6 +180,7 @@ public class MultipartRequestInputStream extends BufferedInputStream {
|
||||
* 跳过边界表示
|
||||
*
|
||||
* @return 跳过的字节数
|
||||
* @throws IOException 读取异常
|
||||
*/
|
||||
public int skipToBoundary() throws IOException {
|
||||
int count = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user