JavaDoc Trivial: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
{{ | {{CategoryBlock | ||
| | |Baustelle=Ja | ||
| | |Java Grundlagen=Ja | ||
| | |Organisation=Nein | ||
|Programmierstil=Nein | |||
|Bewertungsrichtlinie=Nein | |||
|blattAnnotation=2 | |||
|blattAbzug=3 | |||
}} | |||
{{Inhaltsblock | |||
|vorher===== Trivales JavaDoc ==== | |||
Alle nicht-privaten (öffentliche (public), geschützte (protected) und paket-privaten (package-private, ohne Modifikator)) Klassen, Enums, Interfaces, Methoden, Konstanten und Attribute stets ein '''aussagekräftiger''' JavaDoc-Kommentar vorhanden sein muss. Diese Kommentare dienen dazu, Entwicklern und Anwendern die Funktionsweise und Nutzung der Software zu erklären. Dabei ist es unzureichend, lediglich sinnlose, formale oder triviale Kommentare zur Erfüllung von Checkstyle-Vorgaben anzugeben, ohne die Methode oder Funktion angemessen zu dokumentieren, da dies keine hilfreiche Erklärung darstellt. | Alle nicht-privaten (öffentliche (public), geschützte (protected) und paket-privaten (package-private, ohne Modifikator)) Klassen, Enums, Interfaces, Methoden, Konstanten und Attribute stets ein '''aussagekräftiger''' JavaDoc-Kommentar vorhanden sein muss. Diese Kommentare dienen dazu, Entwicklern und Anwendern die Funktionsweise und Nutzung der Software zu erklären. Dabei ist es unzureichend, lediglich sinnlose, formale oder triviale Kommentare zur Erfüllung von Checkstyle-Vorgaben anzugeben, ohne die Methode oder Funktion angemessen zu dokumentieren, da dies keine hilfreiche Erklärung darstellt. | ||
| | }} | ||
| | {{Inhaltsblock | ||
/** | |color=red | ||
|vorher=Negativbeispiel: | |||
|Beispiel=/** | |||
* | * | ||
* @return name | * @return name | ||
| Zeile 14: | Zeile 23: | ||
return this.name; | return this.name; | ||
} | } | ||
|beispielname=JavaDocTrivialBad | |||
}} | |||
| | {{Inhaltsblock | ||
/** | |color=green | ||
|vorher=Positivbeispiel: | |||
|Beispiel=/** | |||
* Gets the full name of the person, i.e. the first name(s) separated by whitespaces, followed by a whitespace and the last name. | * Gets the full name of the person, i.e. the first name(s) separated by whitespaces, followed by a whitespace and the last name. | ||
* This method returns {@code null} if no name was set. | * This method returns {@code null} if no name was set. | ||
| Zeile 26: | Zeile 37: | ||
return this.name; | return this.name; | ||
} | } | ||
|beispielname=JavaDocTrivialGood | |||
| | |||
}} | }} | ||
Aktuelle Version vom 13. Oktober 2025, 15:51 Uhr
| 🚧 | Diese Seite befindet sich in Bearbeitung | 🚧 |
Trivales JavaDoc
Alle nicht-privaten (öffentliche (public), geschützte (protected) und paket-privaten (package-private, ohne Modifikator)) Klassen, Enums, Interfaces, Methoden, Konstanten und Attribute stets ein aussagekräftiger JavaDoc-Kommentar vorhanden sein muss. Diese Kommentare dienen dazu, Entwicklern und Anwendern die Funktionsweise und Nutzung der Software zu erklären. Dabei ist es unzureichend, lediglich sinnlose, formale oder triviale Kommentare zur Erfüllung von Checkstyle-Vorgaben anzugeben, ohne die Methode oder Funktion angemessen zu dokumentieren, da dies keine hilfreiche Erklärung darstellt.
Positivbeispiel:
/**
* Gets the full name of the person, i.e. the first name(s) separated by whitespaces, followed by a whitespace and the last name.
* This method returns {@code null} if no name was set.
*
* @return the full name of the person or {@code null} if no name was set
*/
public String getName() {
return this.name;
}