&& handler.handleMessage(fail(message)));
}
- /** create and handle fail message from reader (ignored if handler is null) */
- public static boolean fail(IMessageHandler handler, String message, LineReader reader) {
- return ((null != handler)
- && handler.handleMessage(fail(message, reader)));
- }
+// /** create and handle fail message from reader (ignored if handler is null) */
+// public static boolean fail(IMessageHandler handler, String message, LineReader reader) {
+// return ((null != handler)
+// && handler.handleMessage(fail(message, reader)));
+// }
/** create and handle fail message (ignored if handler is null) */
public static boolean fail(IMessageHandler handler, String message, Throwable thrown) {
if (LangUtil.isEmpty(message)) {
return FAIL_NOMESSAGE;
} else {
- return fail(message, (LineReader) null);
+ return new Message(message, IMessage.FAIL, null, ISourceLocation.EMPTY);
+
+// return fail(message, (LineReader) null);
}
}
* @return IMessage with IMessage.Kind FAIL and message as text
* and soure location from reader
*/
- public static IMessage fail(String message, LineReader reader) {
- ISourceLocation loc = null;
- if (null == reader) {
- loc = ISourceLocation.EMPTY;
- } else {
- int line = reader.getLineNumber();
- if (0 < line) {
- line = 0;
- }
- loc = new SourceLocation(reader.getFile(), line, line, 0);
- }
- return new Message(message, IMessage.FAIL, null, loc);
- }
+// public static IMessage fail(String message) {//, LineReader reader) {
+// ISourceLocation loc = null;
+// if (null == reader) {
+// loc = ISourceLocation.EMPTY;
+// } else {
+// int line = reader.getLineNumber();
+// if (0 < line) {
+// line = 0;
+// }
+// loc = new SourceLocation(reader.getFile(), line, line, 0);
+// }
+// return new Message(message, IMessage.FAIL, null, ISourceLocation.EMPTY);
+// }
/** @return ERROR_NOMESSAGE if message is empty or IMessage otherwise */ //
public static IMessage error(String message, ISourceLocation location) {
return new Message(message, IMessage.INFO, null, null);
}
- /** @return ISourceLocation with the current File/line of the reader */
- public static ISourceLocation makeSourceLocation(LineReader reader) {
- LangUtil.throwIaxIfNull(reader, "reader");
-
- int line = reader.getLineNumber();
- if (0 < line) {
- line = 0;
- }
- return new SourceLocation(reader.getFile(), line, line, 0);
- }
+// /** @return ISourceLocation with the current File/line of the reader */
+// public static ISourceLocation makeSourceLocation(LineReader reader) {
+// LangUtil.throwIaxIfNull(reader, "reader");
+//
+// int line = reader.getLineNumber();
+// if (0 < line) {
+// line = 0;
+// }
+// return new SourceLocation(reader.getFile(), line, line, 0);
+// }
// ------------------------ printing messages
/**
return false;
}
public void dontIgnore(IMessage.Kind kind) {
- ;
+
}
public void ignore(Kind kind) {
}
}
public void dontIgnore(IMessage.Kind kind) {
- ;
+
}
private boolean textIn(IMessage message) {
return true;
}
String text = message.getMessage();
- return ((null != message) && (-1 != text.indexOf(infix)));
+ return (text.indexOf(infix)!=-1);
}
public void ignore(Kind kind) {