mirror of
https://github.com/HighCapable/SweetProperty.git
synced 2025-09-05 10:15:36 +08:00
fix: 转义属性值中的 $,避免 Javadoc 格式化异常
This commit is contained in:
@@ -203,11 +203,12 @@ internal class PropertiesAccessorsGenerator {
|
|||||||
addMethod(
|
addMethod(
|
||||||
MethodSpec.methodBuilder("get${getOrCreateUsedSuccessiveMethodName(methodName, className).capitalize()}").apply {
|
MethodSpec.methodBuilder("get${getOrCreateUsedSuccessiveMethodName(methodName, className).capitalize()}").apply {
|
||||||
val typedValue = value.parseTypedValue(configs.isEnableTypeAutoConversion)
|
val typedValue = value.parseTypedValue(configs.isEnableTypeAutoConversion)
|
||||||
addJavadoc("Resolve the \"$accessorsName\" value ${typedValue.second}")
|
val safeValueForJavadoc = typedValue.second.replace("$", "$$")
|
||||||
|
addJavadoc("Resolve the \"$accessorsName\" value $safeValueForJavadoc")
|
||||||
addModifiers(Modifier.PUBLIC, Modifier.FINAL)
|
addModifiers(Modifier.PUBLIC, Modifier.FINAL)
|
||||||
.addAnnotation(Nonnull::class.java)
|
.addAnnotation(Nonnull::class.java)
|
||||||
.returns(typedValue.first.java)
|
.returns(typedValue.first.java)
|
||||||
.addStatement("return ${typedValue.second}")
|
.addStatement("return $safeValueForJavadoc")
|
||||||
}.build()
|
}.build()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user