/** * Returns the resources for formatting error messages. */ private IndexedResourceBundle getErrorResources() { return Errors.getResources(locale); }
/** * Gets a string for the given key from this resource bundle or one of its parents. * * @param key The key for the desired string. * @return The string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key) throws MissingResourceException { return getResources(null).getString(key); }
/** * Returns the resources for formatting error messages. */ final IndexedResourceBundle getErrorResources() { return Errors.getResources(getLocale()); }
/** * Returns a localized string for the specified error key. */ final String getString(final int key) { return Errors.getResources(locale).getString(key); }
/** * Returns the resources for formatting error messages. */ final IndexedResourceBundle getErrorResources() { return Errors.getResources(getLocale()); }
/** * Gets a string for the given key from this resource bundle or one of its parents. * * @param key The key for the desired string. * @return The string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key) throws MissingResourceException { return getResources(null).getString(key); }
/** * Returns the resources for formatting error messages. */ final IndexedResourceBundle getErrorResources() { return Errors.getResources(getWarningLocale()); }
/** * Gets a string for the given key are replace all occurence of "{0}" * with values of {@code arg0}. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @return The formatted string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key, final Object arg0) throws MissingResourceException { return getResources(null).getString(key, arg0); }
/** * Gets a string for the given key are replace all occurence of "{0}" * with values of {@code arg0}. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @return The formatted string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key, final Object arg0) throws MissingResourceException { return getResources(null).getString(key, arg0); }
/** * Gets a string for the given key are replace all occurence of "{0}", * "{1}", with values of {@code arg0}, {@code arg1}, etc. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @param arg1 Value to substitute to "{1}". * @param arg2 Value to substitute to "{2}". * @return The formatted string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key, final Object arg0, final Object arg1, final Object arg2) throws MissingResourceException { return getResources(null).getString(key, arg0, arg1, arg2); }
/** * Gets a string for the given key are replace all occurence of "{0}", * "{1}", with values of {@code arg0}, {@code arg1}. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @param arg1 Value to substitute to "{1}". * @return The formatted string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key, final Object arg0, final Object arg1) throws MissingResourceException { return getResources(null).getString(key, arg0, arg1); }
/** * Gets a string for the given key are replace all occurence of "{0}", * "{1}", with values of {@code arg0}, {@code arg1}. * * @param key The key for the desired string. * @param arg0 Value to substitute to "{0}". * @param arg1 Value to substitute to "{1}". * @return The formatted string for the given key. * @throws MissingResourceException If no object for the given key can be found. */ public static String format(final int key, final Object arg0, final Object arg1) throws MissingResourceException { return getResources(null).getString(key, arg0, arg1); }
/** * Check if an angle is of expected type (latitude or longitude). */ private void checkAngle(final JSpinner field, final boolean expectLatitude) throws ParseException { final Object angle=field.getValue(); if (expectLatitude ? (angle instanceof Longitude) : (angle instanceof Latitude)) { throw new ParseException(Errors.getResources(getLocale()).getString( ErrorKeys.BAD_COORDINATE_$1, angle), 0); } }
/** * Checks the format name. */ private void checkFormatName(final String formatName) throws IllegalArgumentException { if (!GeographicMetadataFormat.FORMAT_NAME.equals(formatName)) { throw new IllegalArgumentException(Errors.getResources(getLocale()).getString( ErrorKeys.ILLEGAL_ARGUMENT_$2, "formatName", formatName)); } }
/** * Returns a localized error message for {@link IndexOutOfBoundsException}. */ private String indexOutOfBounds(final int index) { return Errors.getResources(getLocale()). getString(ErrorKeys.ILLEGAL_ARGUMENT_$2, "index", new Integer(index)); }
/** * Convenience method for logging a warning. Do not allow overriding, because * it would not work for warnings emitted by the {@link #getDate} method. */ final void warning(final String method, final int key, final Object value) { if (warningsEnabled) { final LogRecord record = Errors.getResources(metadata.getLocale()). getLogRecord(Level.WARNING, key, value); record.setSourceClassName(MetadataAccessor.class.getName()); record.setSourceMethodName(method); warningOccurred(record); } }
/** * Returns a localized error message for {@link IndexOutOfBoundsException}. */ private String indexOutOfBounds(final int index) { return Errors.getResources(getLocale()). getString(ErrorKeys.ILLEGAL_ARGUMENT_$2, "index", index); }
/** * Implementation of {@link #addOperation} method. Also used by {@link #scanForPlugins} * instead of the public method in order to avoid never-ending loop. */ private void addOperation0(final Operation operation) throws IllegalStateException { final String name = operation.getName().trim(); final Operation old = operations.put(name, operation); if (old!=null && !old.equals(operation)) { operations.put(old.getName().trim(), old); throw new IllegalStateException(Errors.getResources(getLocale()).getString( ErrorKeys.OPERATION_ALREADY_BOUND_$1, operation.getName())); } }
/** * Implementation of {@link #addOperation} method. Also used by {@link #scanForPlugins} * instead of the public method in order to avoid never-ending loop. */ private void addOperation0(final Operation operation) throws IllegalStateException { final String name = operation.getName().trim(); final Operation old = (Operation) operations.put(name, operation); if (old!=null && !old.equals(operation)) { operations.put(old.getName().trim(), old); throw new IllegalStateException(Errors.getResources(getLocale()).getString( ErrorKeys.OPERATION_ALREADY_BOUND_$1, operation.getName())); } }
/** * Constructs an error message for a point outside the coverage. * This is used for formatting error messages. * * @param point The coordinate point to format. * @return An error message. */ protected String pointOutsideCoverage(final DirectPosition point) { final Locale locale = getLocale(); return Errors.getResources(locale). getString(ErrorKeys.POINT_OUTSIDE_COVERAGE_$1, toString(point, locale)); }