Skip to main content

dawdler-util

Module introduction​

Common utility classes, generally not exposed to developers.

1. Add the dependency to the pom​

<groupId>club.dawdler</groupId>
<artifactId>dawdler-util</artifactId>

2. System properties​

The framework's unified entry point for reading dawdler.* system properties is club.dawdler.util.DawdlerConfig; the precedence is: JVM startup parameter (-D) > environment variable (with the key mapped, e.g. dawdler.max.frame.length → DAWDLER_MAX_FRAME_LENGTH) > the top-level properties: section of dawdler-config.yml (supporting profiles / configuration center fallback / ${} placeholders / ENC() encryption) > code default value. For all configuration items, see the dawdler.* configuration reference.

2.1 Global default date/time formats (DateUtil)​

The default formats of DateUtil can be overridden through JVM startup parameters (-D), affecting all date parsing and formatting that uses the default formats (such as time-type parameter binding on the web side):

Property nameDefault value
dawdler.datetime.formatyyyy-MM-dd HH:mm:ss
dawdler.date.formatyyyy-MM-dd
dawdler.time.formatHH:mm:ss
-Ddawdler.datetime.format=yyyy/MM/dd HH:mm:ss

2.2 Configuration placeholder resolution (SystemVariableUtil)​

Configuration files support ${placeholder} placeholders; the resolution precedence is: system property (-D) > OS environment variable; default values using the ${key:defaultValue} syntax are supported:

host=${HOST_NAME:localhost}
port=${SERVER_PORT:8080}

2.3 Environment variables​

Variable nameDescription
DAWDLER_ENCRYPT_FILEPath of the key file (dawdler.password) for decrypting configuration contents, used at runtime to decrypt encrypted configuration; for detailed usage see dawdler-encrypt-generator

3. Third-party code notice​

This module contains source code ported and adapted from third-party projects, all retaining the upstream copyright notices; see NOTICE in the repository root for the complete list:

Package/classSourceLicense
club.dawdler.util.reflectasm (MethodAccess, FieldAccess, ConstructorAccess, AccessClassLoader, PublicConstructorAccess)ReflectASM, modified versionBSD-3-Clause; the full text is in LICENSE-ReflectASM.txt, and it is also shipped with the jar as META-INF/LICENSE-ReflectASM.txt
club.dawdler.util.spring (including the antpath subpackage)MediaType/MimeType, AntPathMatcher, and the resource abstraction of Spring FrameworkApache-2.0
club.dawdler.util.HashedWheelTimerNettyApache-2.0

AccessPolicy, MethodFingerprint, and ParameterNameReader in the club.dawdler.util.reflectasm package are original classes of this repository and contain no third-party code.