checker.src.org.checkerframework.checker.i18nformatter.I18nFormatterAnalysis Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checker Show documentation
Show all versions of checker Show documentation
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.
package org.checkerframework.checker.i18nformatter;
import java.util.List;
import javax.lang.model.element.VariableElement;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.flow.CFAbstractAnalysis;
import org.checkerframework.framework.flow.CFStore;
import org.checkerframework.framework.flow.CFValue;
import org.checkerframework.framework.type.AnnotatedTypeMirror;
import org.checkerframework.javacutil.Pair;
/**
*
* Needed for flow analysis to implement {@link I18nFormatUtil#hasFormat},
* {@link I18nFormatUtil#isFormat}, and MakeFormat in {@link I18nFormatterTransfer}.
*
* @checker_framework.manual #i18n-formatter-checker Internationalization
* Format String Checker
* @author Siwakorn Srisakaokul
*/
public class I18nFormatterAnalysis extends CFAbstractAnalysis {
public I18nFormatterAnalysis(BaseTypeChecker checker, I18nFormatterAnnotatedTypeFactory factory,
List> fieldValues) {
super(checker, factory, fieldValues);
}
@Override
public I18nFormatterTransfer createTransferFunction() {
return new I18nFormatterTransfer(this, (I18nFormatterChecker) checker);
}
@Override
public CFStore createEmptyStore(boolean sequentialSemantics) {
return new CFStore(this, sequentialSemantics);
}
@Override
public CFStore createCopiedStore(CFStore s) {
return new CFStore(this, s);
}
@Override
public CFValue createAbstractValue(AnnotatedTypeMirror type) {
return defaultCreateAbstractValue(this, type);
}
}