ErrorMsgpublic class ErrorMsg extends Object This is a helper class to report error messages from the EJBQL compiler. |
Fields Summary |
---|
private static final ResourceBundle | msgsI18N support. | private static com.sun.jdo.spi.persistence.utility.logging.Logger | loggerThe logger |
Methods Summary |
---|
public static void | error(int line, int col, java.lang.String text)This method throws an EJBQLException indicating an user error.
EJBQLException ex = null;
if (line > 1) {
// include line and column info
Object args[] = {new Integer(line), new Integer(col), text};
ex = new EJBQLException(I18NHelper.getMessage(
msgs, "EXC_PositionInfoMsgLineColumn", args)); //NOI18N
}
else if (col > 0) {
// include column info
Object args[] = {new Integer(col), text};
ex = new EJBQLException(I18NHelper.getMessage(
msgs, "EXC_PositionInfoMsgColumn", args)); //NOI18N
}
else {
ex = new EJBQLException(I18NHelper.getMessage(
msgs, "EXC_PositionInfoMsg", text)); //NOI18N
}
throw ex;
| public static void | error(java.lang.String text, java.lang.Throwable cause)This method throws an EJBQLException indicating an user error.
throw new EJBQLException(text, cause);
| public static void | error(java.lang.String text)This method throws an EJBQLException indicating an user error.
throw new EJBQLException(text);
| public static void | fatal(java.lang.String text)This method is called in the case of an fatal internal error.
throw new EJBQLException(I18NHelper.getMessage(
msgs, "ERR_FatalInternalError", text)); //NOI18N
| public static void | fatal(java.lang.String text, java.lang.Throwable nested)This method is called in the case of an fatal internal error.
throw new EJBQLException(I18NHelper.getMessage(
msgs, "ERR_FatalInternalError", text), nested); //NOI18N
| public static void | log(int level, java.lang.String text, java.lang.Throwable nested)This method is called when we want to log an exception in a given level.
Note that all other methods in this class do not log a stack trace.
logger.log(level, text, nested);
throw new EJBQLException(text, nested);
| public static void | unsupported(int line, int col, java.lang.String text)This method throws an UnsupportedOperationException indicating an
unsupported feature.
UnsupportedOperationException ex;
if (line > 1)
{
// include line and column info
Object args[] = {new Integer(line), new Integer(col), text};
ex = new UnsupportedOperationException(I18NHelper.getMessage(
msgs, "EXC_PositionInfoMsgLineColumn", args)); //NOI18N
}
else if (col > 0) {
// include column info
Object args[] = {new Integer(col), text};
ex = new UnsupportedOperationException(I18NHelper.getMessage(
msgs, "EXC_PositionInfoMsgColumn", args)); //NOI18N
}
else {
Object args[] = {text};
ex = new UnsupportedOperationException(I18NHelper.getMessage(
msgs, "EXC_PositionInfoMsg", args)); //NOI18N
}
throw ex;
|
|