@Test public void testGetString() { final DefaultErrorListener listener = new DefaultErrorListener(); assertEquals("expect passthrough", "testKey", listener.getString("testKey")); ResourceBundle newBundle = ResourceBundle.getBundle(getClass().getName()); listener.setResourceBundle(newBundle); assertEquals("expect from bundle", "yeKtset", listener.getString("testKey")); }
@NotNull protected String getString(@NotNull final String key) { if (getResourceBundle().containsKey(key)) { return getResourceBundle().getString(key); } else { return key; } }
DefaultErrorListener implements ErrorListener { @NotNull protected String getString(@NotNull final String key) { if (getResourceBundle().containsKey(key)) { return getResourceBundle().getString(key); } else { return key; } } }
DefaultErrorListener implements ErrorListener { @NotNull protected String getString(@NotNull final String key) { if (getResourceBundle().containsKey(key)) { return getResourceBundle().getString(key); } else { return key; } }  }
DefaultErrorListener implements ErrorListener { @NotNull protected String getString(@NotNull final String key) { if (getResourceBundle().containsKey(key)) { return getResourceBundle().getString(key); } else { return key; } }  @Override void setResourceBundle(final ResourceBundle resourceBundle); @Override Collection<Violation> getReportedViolations(); @Override void onNodeTypeRegistrationError(final Throwable error, final URL resource); @Override void onJcrNamespaceRegistrationError(final Throwable error, final String prefix, final String uri); @Override void onJcrPrivilegeRegistrationError(final Throwable error, final String jcrPrivilege); @Override void onForcedRootCreationError(final Throwable error, final ForcedRoot forcedRoot); @Override void onListenerException(final Exception error, final ProgressCheck listener, final PackageId packageId); @Override void onSubpackageException(final Exception error, final PackageId packageId); @Override void onImporterException(final Exception error, final PackageId packageId, final String path); @Override void onListenerPathException(final Exception error, final ProgressCheck handler,
                                        final PackageId packageId, final String path); @Override void onInstallHookError(final Throwable error, final PackageId packageId); @Override void onProhibitedInstallHookRegistration(final PackageId packageId); @Override void onRepoInitUrlError(final Throwable error, final URL repoinitUrl); @Override void onRepoInitInlineError(final Throwable error, final List<String> repoinits); @Override void onSlingEmbeddedPackageError(Throwable error, EmbeddedPackageInstallable installable); @Override void onSlingRepoInitScriptsError(Throwable error, List<String> scripts, String failedScript, SlingInstallable installable); @Override void onSlingCreateInstallableError(final Exception error,
                                              final Class<? extends SlingInstallable> installableType,
                                              final PackageId parentId, final String jcrPath); }
DefaultErrorListener implements ErrorListener { @NotNull protected String getString(@NotNull final String key) { if (getResourceBundle().containsKey(key)) { return getResourceBundle().getString(key); } else { return key; } }  @Override void setResourceBundle(final ResourceBundle resourceBundle); @Override Collection<Violation> getReportedViolations(); @Override void onNodeTypeRegistrationError(final Throwable error, final URL resource); @Override void onJcrNamespaceRegistrationError(final Throwable error, final String prefix, final String uri); @Override void onJcrPrivilegeRegistrationError(final Throwable error, final String jcrPrivilege); @Override void onForcedRootCreationError(final Throwable error, final ForcedRoot forcedRoot); @Override void onListenerException(final Exception error, final ProgressCheck listener, final PackageId packageId); @Override void onSubpackageException(final Exception error, final PackageId packageId); @Override void onImporterException(final Exception error, final PackageId packageId, final String path); @Override void onListenerPathException(final Exception error, final ProgressCheck handler,
                                        final PackageId packageId, final String path); @Override void onInstallHookError(final Throwable error, final PackageId packageId); @Override void onProhibitedInstallHookRegistration(final PackageId packageId); @Override void onRepoInitUrlError(final Throwable error, final URL repoinitUrl); @Override void onRepoInitInlineError(final Throwable error, final List<String> repoinits); @Override void onSlingEmbeddedPackageError(Throwable error, EmbeddedPackageInstallable installable); @Override void onSlingRepoInitScriptsError(Throwable error, List<String> scripts, String failedScript, SlingInstallable installable); @Override void onSlingCreateInstallableError(final Exception error,
                                              final Class<? extends SlingInstallable> installableType,
                                              final PackageId parentId, final String jcrPath);  }