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

org.checkerframework.checker.propkey.PropertyKeyChecker 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.44.0
Show newest version
package org.checkerframework.checker.propkey;

import java.util.Locale;
import java.util.ResourceBundle;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.qual.RelevantJavaTypes;
import org.checkerframework.framework.source.SupportedOptions;

/**
 * A type-checker that checks that only valid keys are used to access property files and resource
 * bundles. Subclasses can specialize this class for the different uses of property files, for
 * examples see the I18n Checker and Compiler Messages Checker.
 *
 * 

Currently, the checker supports two methods to check: * *

    *
  1. Property files: A common method for localization using a property file, mapping * the keys to values. Programmers pass the property file locations via {@code propfiles} * option (e.g. {@code -Apropfiles=/path/to/messages.properties}), separating multiple files * by a colon ":". *
  2. {@link ResourceBundle}: 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. *
* * @checker_framework.manual #propkey-checker Property File Checker */ // Subclasses need something similar to this: @SupportedOptions({"propfiles", "bundlenames"}) @RelevantJavaTypes(CharSequence.class) public class PropertyKeyChecker extends BaseTypeChecker {}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy