checkers.i18n
Class LocalizableKeyChecker

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by com.sun.source.util.AbstractTypeProcessor
          extended by checkers.source.SourceChecker
              extended by checkers.basetype.BaseTypeChecker
                  extended by checkers.propkey.PropertyKeyChecker
                      extended by 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:

  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 propfiles option (e.g. -Apropfiles=/path/to/messages.properties), separating multiple files by a colon ":".
  2. 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.


Field Summary
Modifier and Type Field and Description
 
Fields inherited from class checkers.source.SourceChecker
currentPath, currentRoot, env, messager, messages, trees
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
Constructor and Description
LocalizableKeyChecker()
           
 
Method Summary
Modifier and Type Method and Description
 
Methods inherited from class checkers.propkey.PropertyKeyChecker
getLookupKeys, init
 
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 com.sun.source.util.AbstractTypeProcessor
process, typeProcessingOver
 
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizableKeyChecker

public LocalizableKeyChecker()