checkers.i18n
Class LocalizableKeyChecker
java.lang.Object
javax.annotation.processing.AbstractProcessor
com.sun.source.util.AbstractTypeProcessor
checkers.source.SourceChecker
checkers.basetype.BaseTypeChecker
checkers.propkey.PropertyKeyChecker
checkers.i18n.LocalizableKeyChecker
- All Implemented Interfaces:
- Processor
@TypeQualifiers(value={LocalizableKey.class,PropertyKey.class,Unqualified.class})
@SupportedOptions(value={"propfiles","bundlename"})
public class LocalizableKeyChecker
extends PropertyKeyChecker
A type-checker that checks that only valid localizable keys are used
when using localizing methods
(e.g. ResourceBundle.getString(String)
).
Currently, the checker supports two methods for localization checks:
- 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
propfiles
option (e.g. -Apropfiles=/path/to/messages.properties
),
separating multiple files by a colon ":".
ResourceBundle
:
The proper recommended mechanism for localization.
Programmers pass the baseName
name of the bundle via
bundlename
(e.g. -Abundlename=MyResource
. The checker uses
the resource associated with the default Locale
in the compilation
system.
Methods inherited from class checkers.basetype.BaseTypeChecker |
createFactory, createQualifierHierarchy, createSourceVisitor, createSupportedTypeQualifiers, createTypeHierarchy, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, isAssignable, isSubtype, isValidUse |
Methods inherited from class checkers.source.SourceChecker |
fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, message, report, typeProcess |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocalizableKeyChecker
public LocalizableKeyChecker()