+
+ private final String sourceName;
+
+ DeclarationInTextSource(final String sourceName) {
+ this.sourceName = sourceName;
+ }
+
+ public static DeclarationInTextSource inSource(final String sourceName) {
+ return new InSource(sourceName);
+ }
+
+ public static DeclarationInTextSource atLine(final String sourceName, final int line) {
+ return new AtLine(sourceName, line);
+ }
+
+ public static DeclarationInTextSource atPosition(final String sourceName, final int line, final int position) {
+ return new AtPosition(sourceName, line, position);
+ }
+
+ public String getSourceName() {
+ return sourceName;
+ }
+
+ @Override
+ public StatementSource getStatementSource() {
+ return StatementSource.DECLARATION;
+ }
+
+ @Override
+ public abstract String toString();