Documenting properties

Suppose I have a property with an associated getter and setter (the property is not exposed directly) Where should I describe the property? The field javadoc The getter javadoc The setter javadoc Avoiding duplication would be nice (in case of any changes, I absolutely do not want to manually keep the two descriptions in sync). However, documenting a private field doesn't feel right.

Feb 17, 2025 - 16:35
 0
Documenting properties

Suppose I have a property with an associated getter and setter (the property is not exposed directly)

Where should I describe the property?

  • The field javadoc
  • The getter javadoc
  • The setter javadoc

Avoiding duplication would be nice (in case of any changes, I absolutely do not want to manually keep the two descriptions in sync). However, documenting a private field doesn't feel right.