Skip to content

Package: SymmetricCheckException

SymmetricCheckException

nameinstructionbranchcomplexitylinemethod
SymmetricCheckException(String, Attribute)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
create(String, Attribute)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getDescription()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getEndPos()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getMarker()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getStartPosition()
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: package de.fhdw.wtf.common.exception.walker;
2:
3: import de.fhdw.wtf.common.ast.Attribute;
4: import de.fhdw.wtf.common.exception.editor.EditorMarkable;
5: import de.fhdw.wtf.common.exception.editor.EditorMarker;
6: import de.fhdw.wtf.common.token.Position;
7:
8: /**
9: * Diese Fehlermeldung wird in SymmetricCheck.java geworfen, wenn zu einer symmetrischen Beziehung keine Gegenstelle
10: * angegeben wurde.
11: *
12: * @author hfw413hy
13: *
14: */
15: public class SymmetricCheckException extends TaskException implements EditorMarkable {
16:         
17:         /**
18:          * generated.
19:          */
20:         private static final long serialVersionUID = -1608006835364421974L;
21:         
22:         private final Attribute attribute;
23:         
24:         /**
25:          * Erzeugt eine Exception.
26:          *
27:          * @param message
28:          * Die zugrunde liegende Fehlermeldung.
29:          * @param attribute
30:          * Das Attribut dessen Gegenpart fehlt.
31:          * @return Die Fehlermeldung.
32:          */
33:         public static SymmetricCheckException create(final String message, final Attribute attribute) {
34:                 return new SymmetricCheckException(message, attribute);
35:         }
36:         
37:         private SymmetricCheckException(final String message, final Attribute attribute) {
38:                 super(message);
39:                 this.attribute = attribute;
40:         }
41:         
42:         @Override
43:         public EditorMarker getMarker() {
44:                 return EditorMarker.MISSING_SYMMETRIC_PART_MARKER;
45:         }
46:         
47:         @Override
48:         public String getDescription() {
49:                 return this.getMessage();
50:         }
51:         
52:         @Override
53:         public Position getStartPosition() {
54:                 return this.attribute.getFirstToken().getPosition();
55:         }
56:         
57:         @Override
58:         public Position getEndPos() {
59:                 return this.attribute.getLastToken().getPosition();
60:         }
61:         
62: }