Skip to content

Commit

Permalink
fix javadoc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Feuermagier committed Jul 16, 2024
1 parent 49e6183 commit 409fe94
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* @param credits credits given to the student, may be negative
* @param positive null for manual feedback
* @param visibility null for manual feedback
* @param text null for unreferenced manual & automatic feedback,
* @param text null for unreferenced manual & automatic feedback,
* of form "File
* src/edu/kit/informatik/BubbleSort.java at line 13"
* @param reference null for unreferenced manual & automatic feedback,
* @param reference null for unreferenced manual & automatic feedback,
* of form
* "file:src/edu/kit/informatik/BubbleSort.java_line:12"
* @param detailText null for automatic feedback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* A single annotation as part of an assessment. Annotations may be manually
* created, or generated by tools. Annotations may not be created for tests that
* are executed by Artemis.
* are executed by Artemis. Annotations must always be created via an active assessment's methods.
*/
public final class Annotation {
private final String uuid;
Expand All @@ -24,6 +24,12 @@ public final class Annotation {
private final Double customScore;
private final AnnotationSource source;

/**
* Deserializes an annotation from its metajson format
*
* @param dto
* @param mistakeType
*/
public Annotation(AnnotationDTO dto, MistakeType mistakeType) {
this.uuid = dto.uuid();
this.type = mistakeType;
Expand Down Expand Up @@ -58,6 +64,11 @@ public Annotation(AnnotationDTO dto, MistakeType mistakeType) {
this.source = source;
}

/**
* Uniquely identifies this annotation
*
* @return
*/
public String getUUID() {
return uuid;
}
Expand All @@ -66,30 +77,66 @@ public MistakeType getMistakeType() {
return type;
}

/**
* The path of the file this annotation is associated with, including its file ending
*
* @return
*/
public String getFilePath() {
return filePath;
}

/**
* The path of the file this annotation is associated with, excluding its file ending
*
* @return
*/
public String getFilePathWithoutType() {
return this.filePath.replace(".java", "");
}

/**
* The line in the file where this annotation starts (0-based)
*
* @return
*/
public int getStartLine() {
return startLine;
}

/**
* The line in the file where this annotation starts (1-based, for display to the user e.g. in Artemis)
*
* @return
*/
public int getDisplayLine() {
return startLine + 1;
}

/**
* The line in the file where this annotation ends (0-based)
*
* @return
*/
public int getEndLine() {
return endLine;
}

/**
* The custom message associated with this message, if any. Is never empty for custom annotations.
*
* @return
*/
public Optional<String> getCustomMessage() {
return Optional.ofNullable(customMessage);
}

/**
* The custom score associated with this message, if any. Is always empty for predefined annotations,
* and never empty for custom annotations.
*
* @return
*/
public Optional<Double> getCustomScore() {
return Optional.ofNullable(customScore);
}
Expand All @@ -98,6 +145,11 @@ public AnnotationSource getSource() {
return source;
}

/**
* Serializes this annotation to its metajson format
*
* @return
*/
public AnnotationDTO toDTO() {
return new AnnotationDTO(uuid, type.getId(), startLine, endLine, filePath, customMessage, customScore, source);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/**
* An active assessment of a submission for which we hold a lock. This class
* stores annotations, calculates points, and parses & serializes feedbacks for
* stores annotations, calculates points, and parses &amp; serializes feedbacks for
* Artemis.
*/
public class Assessment extends ArtemisConnectionHolder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import edu.kit.kastel.sdq.artemis4j.ArtemisClientException;

/**
* Exception thrown when an error occurs during the mapping of annotations to meta feedback and vice versa.
*/
public class AnnotationMappingException extends ArtemisClientException {
public AnnotationMappingException(String message) {
super(message);
Expand Down

0 comments on commit 409fe94

Please sign in to comment.