checkers.propkey
Class PropertyKeyChecker

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
All Implemented Interfaces:
Processor
Direct Known Subclasses:
CompilerMessagesChecker, LocalizableKeyChecker

@TypeQualifiers(value={PropertyKey.class,Unqualified.class})
@SupportedOptions(value={"propfiles","bundlename"})
public class PropertyKeyChecker
extends BaseTypeChecker

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 and compilermsgs checkers. 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 propfiles option (e.g. -Apropfiles=/path/to/messages.properties), separating multiple files by a colon ":".
  2. ResourceBundle: 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
PropertyKeyChecker()
           
 
Method Summary
Modifier and Type Method and Description
 Set<String> getLookupKeys()
          Returns a set of the valid keys that can be used.
 void init(ProcessingEnvironment env)
          
 
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

PropertyKeyChecker

public PropertyKeyChecker()
Method Detail

init

public void init(ProcessingEnvironment env)
Description copied from class: SourceChecker

Specified by:
init in interface Processor
Overrides:
init in class BaseTypeChecker
See Also:
AbstractProcessor.init(ProcessingEnvironment)

getLookupKeys

public Set<String> getLookupKeys()
Returns a set of the valid keys that can be used.