Skip to content

Method: getStartPosition()

1: package de.fhdw.wtf.common.exception.walker;
2:
3: import de.fhdw.wtf.common.exception.editor.EditorMarkable;
4: import de.fhdw.wtf.common.exception.editor.EditorMarker;
5: import de.fhdw.wtf.common.token.Position;
6: import de.fhdw.wtf.common.token.Token;
7:
8: public final class AbstractOperationsException extends TaskException implements EditorMarkable {
9:         
10:         /**
11:          * generated.
12:          */
13:         private static final long serialVersionUID = -1464057706584735506L;
14:         private final Token firstToken;
15:         private final Token lastToken;
16:         
17:         private AbstractOperationsException(final Token firstToken, final Token lastToken) {
18:                 super(de.fhdw.wtf.common.constants.walker.ExceptionConstants.ABSTRACT_OPERATIONS_MESSAGE);
19:                 this.firstToken = firstToken;
20:                 this.lastToken = lastToken;
21:         }
22:         
23:         public static AbstractOperationsException create(final Token firstToken, final Token lastToken) {
24:                 return new AbstractOperationsException(firstToken, lastToken);
25:         }
26:         
27:         @Override
28:         public Position getStartPosition() {
29:                 return this.firstToken.getPosition();
30:         }
31:         
32:         @Override
33:         public String getDescription() {
34:                 return this.getMessage();
35:         }
36:         
37:         @Override
38:         public Position getEndPos() {
39:                 return this.lastToken.getPosition();
40:         }
41:         
42:         @Override
43:         public EditorMarker getMarker() {
44:                 return EditorMarker.ABSTRACT_OPERATIONS_MARKER;
45:         }
46:         
47: }