-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#23 - CheckResult creation. Replace Violation by CheckResult.
- Loading branch information
Aurore Dupuis
committed
May 23, 2017
1 parent
ec2b22e
commit 756d8bf
Showing
2 changed files
with
210 additions
and
0 deletions.
There are no files selected for viewing
161 changes: 161 additions & 0 deletions
161
fr.cnes.analysis.tools.analyzer/src/fr/cnes/analysis/tools/analyzer/datas/CheckResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
package fr.cnes.analysis.tools.analyzer.datas; | ||
|
||
import java.io.File; | ||
|
||
public class CheckResult { | ||
|
||
/** Check name. */ | ||
private String name; | ||
|
||
/** Check id. */ | ||
private String id; | ||
|
||
/** Langage id. */ | ||
private String langageId; | ||
|
||
/** Check location. */ | ||
private String location; | ||
|
||
/** Check line. */ | ||
private Integer line; | ||
|
||
/** Violation message. */ | ||
private String message; | ||
|
||
/** Metric value. */ | ||
private Float value; | ||
|
||
/** Analysed file. */ | ||
private File file; | ||
|
||
public CheckResult(String name, String id, String langageId) { | ||
// TODO Auto-generated constructor stub | ||
} | ||
|
||
public CheckResult(String name, String id, File file) { | ||
this.name = name; | ||
this.id = id; | ||
this.file = file; | ||
} | ||
|
||
/** | ||
* @return the name | ||
*/ | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
/** | ||
* @param name | ||
* the name to set | ||
*/ | ||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* @return the id | ||
*/ | ||
public String getId() { | ||
return id; | ||
} | ||
|
||
/** | ||
* @param id | ||
* the id to set | ||
*/ | ||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
/** | ||
* @return the location | ||
*/ | ||
public String getLocation() { | ||
return location; | ||
} | ||
|
||
/** | ||
* @param location | ||
* the location to set | ||
*/ | ||
public void setLocation(String location) { | ||
this.location = location; | ||
} | ||
|
||
/** | ||
* @return the line | ||
*/ | ||
public Integer getLine() { | ||
return line; | ||
} | ||
|
||
/** | ||
* @param line | ||
* the line to set | ||
*/ | ||
public void setLine(Integer line) { | ||
this.line = line; | ||
} | ||
|
||
/** | ||
* @return the message | ||
*/ | ||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
/** | ||
* @param message | ||
* the message to set | ||
*/ | ||
public void setMessage(String message) { | ||
this.message = message; | ||
} | ||
|
||
/** | ||
* @return the value | ||
*/ | ||
public Float getValue() { | ||
return value; | ||
} | ||
|
||
/** | ||
* @param value | ||
* the value to set | ||
*/ | ||
public void setValue(Float value) { | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* @return the langageId | ||
*/ | ||
public String getLangageId() { | ||
return langageId; | ||
} | ||
|
||
/** | ||
* @param langageId | ||
* the langageId to set | ||
*/ | ||
public void setLangageId(String langageId) { | ||
this.langageId = langageId; | ||
} | ||
|
||
/** | ||
* @return the file | ||
*/ | ||
public File getFile() { | ||
return file; | ||
} | ||
|
||
/** | ||
* @param file | ||
* the file to set | ||
*/ | ||
public void setFile(File file) { | ||
this.file = file; | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
fr.cnes.analysis.tools.analyzer/src/fr/cnes/analysis/tools/analyzer/datas/Checker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package fr.cnes.analysis.tools.analyzer.datas; | ||
|
||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
import fr.cnes.analysis.tools.analyzer.exception.JFlexException; | ||
|
||
public class Checker { | ||
|
||
private String name; | ||
private String id; | ||
private String langageId; | ||
|
||
/** Check results list. */ | ||
private List<CheckResult> checkResults = new LinkedList<CheckResult>();; | ||
|
||
/** | ||
* Method to add a violation, knowing its location and line. | ||
* | ||
* @param pLocation | ||
* the location | ||
* | ||
* @param pMessage | ||
* violation's message | ||
* @param pLine | ||
* the line | ||
* @throws JFlexException | ||
* exception thrown when cloning error appears | ||
*/ | ||
protected void setError(final String pLocation, final String pMessage, final int pLine) throws JFlexException { | ||
CheckResult checkResult = new CheckResult(name, id, langageId); | ||
checkResult.setLine(pLine); | ||
checkResult.setLocation(pLocation); | ||
checkResult.setMessage(pMessage); | ||
checkResults.add(checkResult); | ||
} | ||
|
||
/** | ||
* | ||
* @param file | ||
* @throws FileNotFoundException | ||
*/ | ||
|
||
public void setInputFile(final File file) throws FileNotFoundException { | ||
this.checkResults = new LinkedList<CheckResult>(); | ||
} | ||
} |