Skip to content

Commit e8f74d9

Browse files
committed
fix: fj-doc-lib-kotlin, generating fun with name 'class'
1 parent 5aab19b commit e8f74d9

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16+
- fj-doc-lib-kotlin, generating fun with name 'class'
1617
- fj-doc-freemarker, html handler now renders fore color for phrase.
1718

1819
## [8.17.7] - 2025-11-20

fj-doc-base-kotlin/src/main/java/org/fugerit/java/doc/base/kotlin/dsl/H.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ class H( text: String = "" ) : HelperDSL.TagWithText( "h" ) {
117117
*/
118118
fun whiteSpaceCollapse( value: Boolean ): H = whiteSpaceCollapsType( this, "white-space-collapse", value )
119119
/**
120-
* Function handling class attribute of the H with specific check on type.
121-
* @return the value for the class attribute.
120+
* Function handling className attribute of the H with specific check on type.
121+
* @return the value for the className attribute.
122122
*/
123-
fun class( value: String ): H = classType( this, "class", value )
123+
fun className( value: String ): H = classNameType( this, "class", value )
124124
/**
125125
* Function handling headLevel attribute of the H with specific check on type.
126126
* @return the value for the headLevel attribute.

fj-doc-base-kotlin/src/main/java/org/fugerit/java/doc/base/kotlin/dsl/HelperDSL.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class HelperDSL {
147147
protected fun <T : Element> textIndentType( tag : T, name : String, v: Int) : T = setAtt( tag, name, v, checkFun4 )
148148
protected fun <T : Element> spaceType( tag : T, name : String, v: Int) : T = setAtt( tag, name, v, checkFun4 )
149149
protected fun <T : Element> whiteSpaceCollapsType( tag : T, name : String, v: Boolean) : T = setAtt( tag, name, v )
150-
protected fun <T : Element> classType( tag : T, name : String, v: String) : T = setAtt( tag, name, v )
150+
protected fun <T : Element> classNameType( tag : T, name : String, v: String) : T = setAtt( tag, name, v )
151151
protected fun <T : Element> columnsType( tag : T, name : String, v: Int) : T = setAtt( tag, name, v, checkFun9 )
152152
protected fun <T : Element> percentageType( tag : T, name : String, v: Int) : T = setAtt( tag, name, v, checkFun10 )
153153
protected fun <T : Element> tableRenderModeType( tag : T, name : String, v: String) : T = setAtt( tag, name, v, checkFun11 )

fj-doc-base-kotlin/src/main/java/org/fugerit/java/doc/base/kotlin/dsl/Para.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ class Para( text: String = "" ) : HelperDSL.TagWithText( "para" ) {
117117
*/
118118
fun whiteSpaceCollapse( value: Boolean ): Para = whiteSpaceCollapsType( this, "white-space-collapse", value )
119119
/**
120-
* Function handling class attribute of the Para with specific check on type.
121-
* @return the value for the class attribute.
120+
* Function handling className attribute of the Para with specific check on type.
121+
* @return the value for the className attribute.
122122
*/
123-
fun class( value: String ): Para = classType( this, "class", value )
123+
fun className( value: String ): Para = classNameType( this, "class", value )
124124

125125
}

fj-doc-base-kotlin/src/main/java/org/fugerit/java/doc/base/kotlin/dsl/Phrase.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class Phrase( text: String = "" ) : HelperDSL.TagWithText( "phrase" ) {
5656
*/
5757
fun anchor( value: String ): Phrase = setAtt( this, "anchor", value )
5858
/**
59-
* Function handling class attribute of the Phrase with specific check on type.
60-
* @return the value for the class attribute.
59+
* Function handling className attribute of the Phrase with specific check on type.
60+
* @return the value for the className attribute.
6161
*/
62-
fun class( value: String ): Phrase = classType( this, "class", value )
62+
fun className( value: String ): Phrase = classNameType( this, "class", value )
6363

6464
}

fj-doc-lib-kotlin/src/main/java/org/fugerit/java/doc/base/kotlin/gen/GenerateKotlinConfig.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ public String toKotlinClass( String tagName ) {
5454

5555
public String toKotlinFun( String tagName ) {
5656
String s = this.toKotlinClass( tagName );
57-
return s.substring( 0, 1 ).toLowerCase()+s.substring( 1 );
57+
String result = s.substring( 0, 1 ).toLowerCase()+s.substring( 1 );
58+
if ( "class".equals( result ) ) {
59+
return "className";
60+
} else {
61+
return result;
62+
}
5863
}
5964

6065
public String toCheckTypeFun( final String typeName ) {

0 commit comments

Comments
 (0)