Skip to content

Package: EditorMarkableConstructorException

EditorMarkableConstructorException

nameinstructionbranchcomplexitylinemethod
EditorMarkableConstructorException(SyntaxObject, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
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: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMarker()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getStartPosition()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package de.fhdw.wtf.common.exception.walker;
2:
3: import de.fhdw.wtf.common.ast.SyntaxObject;
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: * Represents the mismatch between a constructors name and its corresponding classes name.
10: */
11: public abstract class EditorMarkableConstructorException extends TaskException implements EditorMarkable {
12:         
13:         /**
14:          * The constructor referenced by this exception.
15:          */
16:         private final SyntaxObject constructor;
17:         
18:         /**
19:          * Instantiates a {@link EditorMarkableConstructorException}.
20:          *
21:          * @param constructor
22:          * the constructor which has the mismatching name.
23:          * @param message
24:          * the exception message.
25:          */
26:         protected EditorMarkableConstructorException(final SyntaxObject constructor, final String message) {
27:                 super(message);
28:                 this.constructor = constructor;
29:         }
30:         
31:         @Override
32:         public Position getStartPosition() {
33:                 return this.constructor.getFirstToken().getPosition();
34:         }
35:         
36:         @Override
37:         public String getDescription() {
38:                 return this.getMessage();
39:         }
40:         
41:         @Override
42:         public Position getEndPos() {
43:                 return this.constructor.getLastToken().getPosition();
44:         }
45:         
46:         @Override
47:         public EditorMarker getMarker() {
48:                 return EditorMarker.INVALID_CONSTRUCTOR_MARKER;
49:         }
50: }