1 11 12 package org.eclipse.jdt.core.dom; 13 14 20 public class Message { 21 22 25 private String message; 26 27 30 private int startPosition; 31 32 36 private int length; 37 38 48 public Message(String message, int startPosition) { 49 if (message == null) { 50 throw new IllegalArgumentException (); 51 } 52 if (startPosition < -1) { 53 throw new IllegalArgumentException (); 54 } 55 this.message = message; 56 this.startPosition = startPosition; 57 this.length = 0; 58 } 59 60 73 public Message(String message, int startPosition, int length) { 74 if (message == null) { 75 throw new IllegalArgumentException (); 76 } 77 if (startPosition < -1) { 78 throw new IllegalArgumentException (); 79 } 80 this.message = message; 81 this.startPosition = startPosition; 82 if (length <= 0) { 83 this.length = 0; 84 } else { 85 this.length = length; 86 } 87 } 88 89 94 public String getMessage() { 95 return message; 96 } 97 98 107 public int getSourcePosition() { 108 return getStartPosition(); 109 } 110 111 119 public int getStartPosition() { 120 return startPosition; 121 } 122 123 131 public int getLength() { 132 return length; 133 } 134 } 135 | Popular Tags |