@Override public final boolean isSuccess() { return currentLevel.compareTo(LogLevel.ERROR) < 0; }
@Override public final boolean isSuccess() { return currentLevel.compareTo(LogLevel.ERROR) < 0; }
@Override public final boolean isSuccess() { return currentLevel.compareTo(LogLevel.ERROR) < 0; }
/** * Main dispatch method * * All messages logged go through this method. According to the report * configuration, the message will either be ignored, logged or raise an * exception. * * @param message the message to log * @throws ProcessingException the message's level and report configuration * require that an exception be thrown */ private void dispatch(final ProcessingMessage message) throws ProcessingException { final LogLevel level = message.getLogLevel(); if (level.compareTo(exceptionThreshold) >= 0) throw message.asException(); if (level.compareTo(currentLevel) > 0) currentLevel = level; if (level.compareTo(logLevel) >= 0) log(message); }
/** * Main dispatch method * * <p>All messages logged go through this method. According to the report * configuration, the message will either be ignored, logged or raise an * exception.</p> * * @param message the message to log * @throws ProcessingException the message's level and report configuration * require that an exception be thrown */ protected final void dispatch(final ProcessingMessage message) throws ProcessingException { final LogLevel level = message.getLogLevel(); if (level.compareTo(exceptionThreshold) >= 0) throw message.asException(); if (level.compareTo(currentLevel) > 0) currentLevel = level; if (level.compareTo(logLevel) >= 0) log(level, message); }
/** * Main dispatch method * * <p>All messages logged go through this method. According to the report * configuration, the message will either be ignored, logged or raise an * exception.</p> * * @param message the message to log * @throws ProcessingException the message's level and report configuration * require that an exception be thrown */ protected final void dispatch(final ProcessingMessage message) throws ProcessingException { final LogLevel level = message.getLogLevel(); if (level.compareTo(exceptionThreshold) >= 0) throw message.asException(); if (level.compareTo(currentLevel) > 0) currentLevel = level; if (level.compareTo(logLevel) >= 0) log(level, message); }
/** * Main dispatch method * * <p>All messages logged go through this method. According to the report * configuration, the message will either be ignored, logged or raise an * exception.</p> * * @param message the message to log * @throws ProcessingException the message's level and report configuration * require that an exception be thrown */ protected final void dispatch(final ProcessingMessage message) throws ProcessingException { final LogLevel level = message.getLogLevel(); if (level.compareTo(exceptionThreshold) >= 0) throw message.asException(); if (level.compareTo(currentLevel) > 0) currentLevel = level; if (level.compareTo(logLevel) >= 0) log(level, message); }
@Override public final void mergeWith(final ProcessingReport other) throws ProcessingException { /* * The other report may have no messages, and as such the successful * status won't be overriden: we have to do that instead */ if (!other.isSuccess() && currentLevel.compareTo(LogLevel.ERROR) < 0) currentLevel = LogLevel.ERROR; for (final ProcessingMessage message: other) dispatch(message); }
@Override public final void mergeWith(final ProcessingReport other) throws ProcessingException { /* * The other report may have no messages, and as such the successful * status won't be overriden: we have to do that instead */ if (!other.isSuccess() && currentLevel.compareTo(LogLevel.ERROR) < 0) currentLevel = LogLevel.ERROR; for (final ProcessingMessage message: other) dispatch(message); }
@Override public final void mergeWith(final ProcessingReport other) throws ProcessingException { /* * The other report may have no messages, and as such the successful * status won't be overriden: we have to do that instead */ if (!other.isSuccess() && currentLevel.compareTo(LogLevel.ERROR) < 0) currentLevel = LogLevel.ERROR; for (final ProcessingMessage message: other) dispatch(message); }
private void validateWithSchema(JsonNode model) { createValidator(); try { ProcessingReport report = validator.validate(model); if (report != null) { List<String> msgs = Lists.newArrayList(); report.forEach(msg -> { if (msg.getLogLevel().compareTo(LogLevel.ERROR) >= 0) { String ptr = msg.asJson().at("/instance/pointer").asText(); msgs.add(String.format("At %s: %s", ptr.isEmpty() ? "/" : ptr, msg.getMessage())); } }); if (!msgs.isEmpty()) { throw new RealizationModelParseException(msgs); } } } catch (ProcessingException e) { e.printStackTrace(); } }