All Downloads are FREE. Search and download functionalities are using the official Maven repository.

checker.src.org.checkerframework.checker.i18n.LocalizableKeyChecker Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java’s type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.42.0
Show newest version
package org.checkerframework.checker.i18n;

import javax.annotation.processing.SupportedOptions;

import org.checkerframework.checker.propkey.PropertyKeyChecker;
import java.util.ResourceBundle;
import java.util.Locale;

/**
 * A type-checker that checks that only valid localizable keys are used
 * when using localizing methods
 * (e.g. {@link ResourceBundle#getString(String)}).
 *
 * Currently, the checker supports two methods for localization checks:
 *
 * 
    *
  1. Properties files: * A common method for localization using a properties file, mapping the * localization keys to localized messages. * Programmers pass the property file location via * {@code propfiles} option (e.g. {@code -Apropfiles=/path/to/messages.properties}), * separating multiple files by a colon ":". *
  2. * *
  3. {@link ResourceBundle}: * The proper recommended mechanism for localization. * Programmers pass the {@code baseName} name of the bundle via * {@code bundlename} (e.g. {@code -Abundlename=MyResource}. The checker uses * the resource associated with the default {@link Locale} in the compilation * system. *
  4. * *
*/ @SupportedOptions( {"propfiles", "bundlenames"} ) public class LocalizableKeyChecker extends PropertyKeyChecker { }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy