@ConsumerType public class SimpleProgressCheck extends Object implements ProgressCheck
ProgressCheck with convenient methods for reporting and collecting violations.| Modifier and Type | Field and Description |
|---|---|
protected ReportCollector |
collector |
| Constructor and Description |
|---|
SimpleProgressCheck() |
| Modifier and Type | Method and Description |
|---|---|
Collection<Violation> |
getReportedViolations()
Called at the end of execution to collect any detected violations.
|
protected @Nullable ResourceBundle |
getResourceBundle()
Used by
getString(String) to retrieve localized messages. |
protected @NotNull String |
getString(@NotNull String key)
Lookup a localized string from the resource bundle.
|
protected void |
majorViolation(String description,
org.apache.jackrabbit.vault.packaging.PackageId... packages) |
protected void |
minorViolation(String description,
org.apache.jackrabbit.vault.packaging.PackageId... packages) |
protected void |
reporting(@NotNull Consumer<SimpleViolation.Builder> customizer)
Report a violation with a customizing consumer function.
|
protected void |
reportViolation(Severity severity,
String description,
org.apache.jackrabbit.vault.packaging.PackageId... packages) |
protected void |
reportViolation(Violation violation) |
void |
setResourceBundle(ResourceBundle resourceBundle)
Called by the framework before a scan to provide a resource bundle for immediate localization of strings.
|
protected void |
severeViolation(String description,
org.apache.jackrabbit.vault.packaging.PackageId... packages) |
void |
startedScan()
Called once at the beginning of the scan to notify for re-initialization of listener state.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterExtract, beforeExtract, deletedPath, getCheckName, identifyPackage, identifySubpackage, importedPath, importedPath, readManifestfinishedScangetResourceBundleBaseNameprotected final ReportCollector collector
public void setResourceBundle(ResourceBundle resourceBundle)
ViolationReportersetResourceBundle in interface ViolationReporterresourceBundle - the resource bundle@Nullable protected @Nullable ResourceBundle getResourceBundle() throws MissingResourceException
getString(String) to retrieve localized messages.
NOTE: If this method is called before a non-null ResourceBundle has been injected via
ViolationReporter.setResourceBundle(ResourceBundle), it will try to get a fallback ResourceBundle
by calling ResourceBundle.getBundle(String), which invokes the default classloader and locale behavior,
using ViolationReporter.getResourceBundleBaseName() as the resource bundle base name.MissingResourceExceptionResourceBundle.getBundle(String),
ViolationReporter.getResourceBundleBaseName()@NotNull protected @NotNull String getString(@NotNull @NotNull String key)
key - the i18n keyMissingResourceException - if an attempt is made to load a missing ResourceBundleprotected void reportViolation(Violation violation)
protected final void reporting(@NotNull
@NotNull Consumer<SimpleViolation.Builder> customizer)
customizer - the customizing consumer functionprotected final void reportViolation(Severity severity, String description, org.apache.jackrabbit.vault.packaging.PackageId... packages)
protected final void minorViolation(String description, org.apache.jackrabbit.vault.packaging.PackageId... packages)
protected final void majorViolation(String description, org.apache.jackrabbit.vault.packaging.PackageId... packages)
protected final void severeViolation(String description, org.apache.jackrabbit.vault.packaging.PackageId... packages)
public void startedScan()
ScanListenerstartedScan in interface ScanListenerpublic Collection<Violation> getReportedViolations()
ViolationReportergetReportedViolations in interface ViolationReporterCopyright © 2017–2020. All rights reserved.