本文整理了Java中org.apache.sis.util.logging.WarningListeners.warning()
方法的一些代码示例,展示了WarningListeners.warning()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WarningListeners.warning()
方法的具体详情如下:
包路径:org.apache.sis.util.logging.WarningListeners
类名称:WarningListeners
方法名:warning
[英]Reports a warning represented by the given message and exception. At least one of message and exception shall be non-null. If both are non-null, then the exception message will be concatenated after the given message. If the exception is non-null, its stack trace will be omitted at logging time for avoiding to pollute console output (keeping in mind that this method should be invoked only for non-fatal warnings). See #warning(Level,String,Exception) for more explanation.
This method is a shortcut for #warning(Level,String,Exception)( Level#WARNING, message, exception)
.
[中]报告由给定消息和异常表示的警告。消息和异常中至少有一个应为非空。如果两者都不为null,则异常消息将在给定消息之后串联。如果异常为非null,则在记录时将忽略其堆栈跟踪,以避免污染控制台输出(请记住,此方法应仅在非致命警告时调用)。有关更多说明,请参阅#警告(级别、字符串、异常)。
此方法是[$0$]的快捷方式。
代码示例来源:origin: org.apache.sis.storage/sis-netcdf
/**
* Invoked when a non-fatal exception occurred while reading metadata.
* This method sends a record to the registered listeners if any,
* or logs the record otherwise.
*/
private void warning(final Exception e) {
decoder.listeners.warning(null, e);
}
代码示例来源:origin: apache/sis
/**
* Reports a warning represented by the given message and exception.
* At least one of {@code message} and {@code exception} shall be non-null.
*
* @param message the message to log, or {@code null} if none.
* @param exception the exception to log, or {@code null} if none.
*/
final void warning(final String message, final Exception exception) {
listeners.warning(message, exception);
}
代码示例来源:origin: apache/sis
/**
* Invoked by the UCAR netCDF library when an error occurred.
*
* @param message the error message.
*/
@Override
public void setError(final String message) {
listeners.warning(message, null);
}
代码示例来源:origin: apache/sis
/**
* Invoked when a non-fatal exception occurred while reading metadata.
* This method sends a record to the registered listeners if any,
* or logs the record otherwise.
*/
private void warning(final Exception e) {
decoder.listeners.warning(null, e);
}
代码示例来源:origin: org.apache.sis.storage/sis-netcdf
/**
* Invoked by the UCAR netCDF library when an error occurred.
*
* @param message the error message.
*/
@Override
public void setError(final String message) {
listeners.warning(message, null);
}
代码示例来源:origin: org.apache.sis.storage/sis-storage
/** Reports the occurrence of a non-fatal error during XML unmarshalling. */
@Override public void warningOccured(final Object source, final LogRecord warning) {
warning.setLoggerName(Loggers.XML);
listeners.warning(warning);
}
});
代码示例来源:origin: apache/sis
/** Reports the occurrence of a non-fatal error during XML unmarshalling. */
@Override public void warningOccured(final Object source, final LogRecord warning) {
warning.setLoggerName(Loggers.XML);
listeners.warning(warning);
}
});
代码示例来源:origin: apache/sis
/**
* Logs a warning as if it originated from the {@link #features(boolean)} method.
* This is a callback method for {@link FeatureIterator}.
*/
final void log(final LogRecord warning) {
warning.setSourceClassName(Store.class.getName());
warning.setSourceMethodName("features");
listeners.warning(warning);
}
代码示例来源:origin: org.apache.sis.storage/sis-storage
/**
* Logs a warning as if it originated from the {@link #features(boolean)} method.
* This is a callback method for {@link FeatureIterator}.
*/
final void log(final LogRecord warning) {
warning.setSourceClassName(Store.class.getName());
warning.setSourceMethodName("features");
listeners.warning(warning);
}
代码示例来源:origin: org.apache.sis.storage/sis-storage
/**
* Reports a warning.
*/
private void log(final LogRecord record) {
record.setSourceClassName(Store.class.getName());
record.setSourceMethodName("getMetadata"); // Public facade for the parse() method.
record.setLoggerName(Loggers.WKT);
listeners.warning(record);
}
代码示例来源:origin: org.apache.sis.storage/sis-storage
/**
* Reports a warning, if non-null.
*/
private void log(final LogRecord record) {
if (record != null) {
record.setSourceClassName(Store.class.getName());
record.setSourceMethodName("getMetadata"); // Public facade for the parse() method.
record.setLoggerName(Loggers.XML);
listeners.warning(record);
}
}
代码示例来源:origin: apache/sis
/**
* Reports a warning, if non-null.
*/
private void log(final LogRecord record) {
if (record != null) {
record.setSourceClassName(Store.class.getName());
record.setSourceMethodName("getMetadata"); // Public facade for the parse() method.
record.setLoggerName(Loggers.XML);
listeners.warning(record);
}
}
代码示例来源:origin: org.apache.sis.core/sis-metadata
/**
* Reports a warning.
*
* @param source the source class, either {@code MetadataSource} or {@code MetadataWriter}.
* @param method the method to report as the warning emitter.
* @param record the warning to report.
*/
final void warning(final Class<? extends MetadataSource> source, final String method, final LogRecord record) {
record.setSourceClassName(source.getCanonicalName());
record.setSourceMethodName(method);
record.setLoggerName(Loggers.SQL);
listeners.warning(record);
}
代码示例来源:origin: org.apache.sis.storage/sis-netcdf
/**
* Sends the given message to the listeners if the message is non-white.
*/
private void warning(CharSequence message) {
message = CharSequences.trimWhitespaces(message);
if (message.length() != 0) {
listeners.warning(message.toString(), null);
}
}
}
代码示例来源:origin: apache/sis
/**
* Sends the given message to the listeners if the message is non-white.
*/
private void warning(CharSequence message) {
message = CharSequences.trimWhitespaces(message);
if (message.length() != 0) {
listeners.warning(message.toString(), null);
}
}
}
代码示例来源:origin: org.apache.sis.storage/sis-storage
/**
* Logs a warning about a file that could be read, but happen to be a directory that we have read previously.
* We could add the existing {@link Aggregate} instance in the parent {@code Aggregate} that we are building,
* but doing so may create a cycle. Current version logs a warning instead because users may not be prepared
* to handle cycles. Not that we have no guarantee that a cycle really exists at this stage, only that it may
* exist.
*/
private void sharedRepository(final Path candidate) {
if (!sharedRepositoryReported) {
sharedRepositoryReported = true;
listeners.warning(message(Resources.Keys.SharedDirectory_1, candidate), null);
}
}
代码示例来源:origin: apache/sis
/**
* Logs a warning about a file that could be read, but happen to be a directory that we have read previously.
* We could add the existing {@link Aggregate} instance in the parent {@code Aggregate} that we are building,
* but doing so may create a cycle. Current version logs a warning instead because users may not be prepared
* to handle cycles. Not that we have no guarantee that a cycle really exists at this stage, only that it may
* exist.
*/
private void sharedRepository(final Path candidate) {
if (!sharedRepositoryReported) {
sharedRepositoryReported = true;
listeners.warning(message(Resources.Keys.SharedDirectory_1, candidate), null);
}
}
代码示例来源:origin: apache/sis
/**
* Logs a warning using the localized error resource bundle for the locale given by
* {@link WarningListeners#getLocale()}.
*
* @param key one of {@link Errors.Keys} values.
*/
private void warning(final short key, final Object p1, final Object p2, final Exception e) {
final WarningListeners<DataStore> listeners = decoder.listeners;
listeners.warning(Errors.getResources(listeners.getLocale()).getString(key, p1, p2), e);
}
代码示例来源:origin: org.apache.sis.storage/sis-storage
/**
* Reports a warning for a WKT that can not be read. This method should be invoked only when the CRS
* can not be created at all; it should not be invoked if the CRS has been created with some warnings.
*/
final void log(final Exception e) {
final DataStore store = listeners.getSource();
listeners.warning(Resources.forLocale(store.getLocale())
.getString(Resources.Keys.CanNotReadCRS_WKT_1, store.getDisplayName()), e);
}
代码示例来源:origin: apache/sis
/**
* Reports a warning for a WKT that can not be read. This method should be invoked only when the CRS
* can not be created at all; it should not be invoked if the CRS has been created with some warnings.
*/
final void log(final Exception e) {
final DataStore store = listeners.getSource();
listeners.warning(Resources.forLocale(store.getLocale())
.getString(Resources.Keys.CanNotReadCRS_WKT_1, store.getDisplayName()), e);
}
内容来源于网络,如有侵权,请联系作者删除!