diff --git a/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/charles7c/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaProperties.java b/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/charles7c/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaProperties.java index cd8acd71..ef2a93d7 100644 --- a/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/charles7c/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaProperties.java +++ b/continew-starter-captcha/continew-starter-captcha-graphic/src/main/java/top/charles7c/continew/starter/captcha/graphic/autoconfigure/GraphicCaptchaProperties.java @@ -20,8 +20,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import top.charles7c.continew.starter.captcha.graphic.enums.GraphicCaptchaType; import top.charles7c.continew.starter.core.constant.PropertiesConstants; -import java.awt.*; - /** * 图形验证码配置属性 * diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/PropertiesConstants.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/PropertiesConstants.java index eae74cca..41643267 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/PropertiesConstants.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/PropertiesConstants.java @@ -24,9 +24,6 @@ package top.charles7c.continew.starter.core.constant; */ public class PropertiesConstants { - private PropertiesConstants() { - } - /** * ContiNew Starter */ @@ -106,4 +103,7 @@ public class PropertiesConstants { * 行为验证码配置 */ public static final String CAPTCHA_BEHAVIOR = CAPTCHA + ".behavior"; + + private PropertiesConstants() { + } } diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java index 52a949ba..b8f51290 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/constant/StringConstants.java @@ -16,18 +16,216 @@ package top.charles7c.continew.starter.core.constant; +import cn.hutool.core.text.CharPool; import cn.hutool.core.text.StrPool; +import cn.hutool.core.util.XmlUtil; /** * 字符串相关常量 * + * @author looly * @author Charles7c * @since 1.0.0 */ -public class StringConstants implements StrPool { +public class StringConstants { - private StringConstants() { - } + /** + * 字符常量:空格符 {@code ' '} + */ + public static final char C_SPACE = CharPool.SPACE; + + /** + * 字符常量:制表符 {@code '\t'} + */ + public static final char C_TAB = CharPool.TAB; + + /** + * 字符常量:点 {@code '.'} + */ + public static final char C_DOT = CharPool.DOT; + + /** + * 字符常量:斜杠 {@code '/'} + */ + public static final char C_SLASH = CharPool.SLASH; + + /** + * 字符常量:反斜杠 {@code '\\'} + */ + public static final char C_BACKSLASH = CharPool.BACKSLASH; + + /** + * 字符常量:回车符 {@code '\r'} + */ + public static final char C_CR = CharPool.CR; + + /** + * 字符常量:换行符 {@code '\n'} + */ + public static final char C_LF = CharPool.LF; + + /** + * 字符常量:下划线 {@code '_'} + */ + public static final char C_UNDERLINE = CharPool.UNDERLINE; + + /** + * 字符常量:逗号 {@code ','} + */ + public static final char C_COMMA = CharPool.COMMA; + + /** + * 字符常量:花括号(左) '{' + */ + public static final char C_DELIM_START = CharPool.DELIM_START; + + /** + * 字符常量:花括号(右) '}' + */ + public static final char C_DELIM_END = CharPool.DELIM_END; + + /** + * 字符常量:中括号(左) {@code '['} + */ + public static final char C_BRACKET_START = CharPool.BRACKET_START; + + /** + * 字符常量:中括号(右) {@code ']'} + */ + public static final char C_BRACKET_END = CharPool.BRACKET_END; + + /** + * 字符常量:冒号 {@code ':'} + */ + public static final char C_COLON = CharPool.COLON; + + /** + * 字符常量:艾特 {@code '@'} + */ + public static final char C_AT = CharPool.AT; + + /** + * 字符串常量:制表符 {@code "\t"} + */ + public static final String TAB = StrPool.TAB; + + /** + * 字符串常量:点 {@code "."} + */ + public static final String DOT = StrPool.DOT; + + /** + * 字符串常量:双点 {@code ".."}
+ * 用途:作为指向上级文件夹的路径,如:{@code "../path"} + */ + public static final String DOUBLE_DOT = StrPool.DOUBLE_DOT; + + /** + * 字符串常量:斜杠 {@code "/"} + */ + public static final String SLASH = StrPool.SLASH; + + /** + * 字符串常量:反斜杠 {@code "\\"} + */ + public static final String BACKSLASH = StrPool.BACKSLASH; + + /** + * 字符串常量:回车符 {@code "\r"}
+ * 解释:该字符常用于表示 Linux 系统和 MacOS 系统下的文本换行 + */ + public static final String CR = StrPool.CR; + + /** + * 字符串常量:换行符 {@code "\n"} + */ + public static final String LF = StrPool.LF; + + /** + * 字符串常量:Windows 换行 {@code "\r\n"}
+ * 解释:该字符串常用于表示 Windows 系统下的文本换行 + */ + public static final String CRLF = StrPool.CRLF; + + /** + * 字符串常量:下划线 {@code "_"} + */ + public static final String UNDERLINE = StrPool.UNDERLINE; + + /** + * 字符串常量:减号(连接符) {@code "-"} + */ + public static final String DASHED = StrPool.DASHED; + + /** + * 字符串常量:逗号 {@code ","} + */ + public static final String COMMA = StrPool.COMMA; + + /** + * 字符串常量:花括号(左) "{" + */ + public static final String DELIM_START = StrPool.DELIM_START; + + /** + * 字符串常量:花括号(右) "}" + */ + public static final String DELIM_END = StrPool.DELIM_END; + + /** + * 字符串常量:中括号(左) {@code "["} + */ + public static final String BRACKET_START = StrPool.BRACKET_START; + + /** + * 字符串常量:中括号(右) {@code "]"} + */ + public static final String BRACKET_END = StrPool.BRACKET_END; + + /** + * 字符串常量:冒号 {@code ":"} + */ + public static final String COLON = StrPool.COLON; + + /** + * 字符串常量:艾特 {@code "@"} + */ + public static final String AT = StrPool.AT; + + /** + * 字符串常量:HTML 不间断空格转义 {@code " " -> " "} + */ + public static final String HTML_NBSP = XmlUtil.NBSP; + + /** + * 字符串常量:HTML And 符转义 {@code "&" -> "&"} + */ + public static final String HTML_AMP = XmlUtil.AMP; + + /** + * 字符串常量:HTML 双引号转义 {@code """ -> "\""} + */ + public static final String HTML_QUOTE = XmlUtil.QUOTE; + + /** + * 字符串常量:HTML 单引号转义 {@code "&apos" -> "'"} + */ + public static final String HTML_APOS = XmlUtil.APOS; + + /** + * 字符串常量:HTML 小于号转义 {@code "<" -> "<"} + */ + public static final String HTML_LT = XmlUtil.LT; + + /** + * 字符串常量:HTML 大于号转义 {@code ">" -> ">"} + */ + public static final String HTML_GT = XmlUtil.GT; + + /** + * 字符串常量:空 JSON {@code "{}"} + */ + public static final String EMPTY_JSON = StrPool.EMPTY_JSON; /** * 空字符串 @@ -68,4 +266,7 @@ public class StringConstants implements StrPool { * 路径模式(仅匹配当前目录) */ public static final String PATH_PATTERN_CURRENT_DIR = "/*"; + + private StringConstants() { + } }