Skip to content

Commit 14fd26b

Browse files
committed
Use description and long description annotations for Java
1 parent c6badfd commit 14fd26b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Templates/Java/BaseJavaModel.template.tt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ public {1} {2}{3}{4} {{";
10821082
property.Name,
10831083
propertyType,
10841084
property.Name.SanitizePropertyName(property).ToLowerFirstChar(),
1085-
ReplaceInvalidCharacters(property.LongDescription));
1085+
GetSanitizedDescription(property));
10861086
}
10871087
return sb.ToString();
10881088
}
@@ -1260,4 +1260,14 @@ public {1} {2}{3}{4} {{";
12601260
}
12611261
return null;
12621262
}
1263-
#>
1263+
1264+
/**
1265+
* Get the description from the LongDescription or Description annotation and then return the sanitized string.
1266+
*/
1267+
public string GetSanitizedDescription(OdcmProperty property)
1268+
{
1269+
var description = property.LongDescription ?? property.Description;
1270+
1271+
return ReplaceInvalidCharacters(description);
1272+
}
1273+
#>

0 commit comments

Comments
 (0)