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

org.checkerframework.checker.compilermsgs.CompilerMessagesAnnotatedTypeFactory 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.compilermsgs;

import org.checkerframework.checker.compilermsgs.qual.CompilerMessageKey;
import org.checkerframework.checker.propkey.PropertyKeyAnnotatedTypeFactory;
import org.checkerframework.common.basetype.BaseTypeChecker;
import org.checkerframework.framework.type.treeannotator.ListTreeAnnotator;
import org.checkerframework.framework.type.treeannotator.TreeAnnotator;

/** A PropertyKeyATF that uses CompilerMessageKey to annotate the keys. */
public class CompilerMessagesAnnotatedTypeFactory extends PropertyKeyAnnotatedTypeFactory {

  public CompilerMessagesAnnotatedTypeFactory(BaseTypeChecker checker) {
    super(checker);
    // Does not call postInit() because its superclass does.
    // If we ever add code to this constructor, it needs to:
    //   * call a superclass constructor that does not call postInit(), and
    //   * call postInit() itself.
  }

  @Override
  public TreeAnnotator createTreeAnnotator() {
    return new ListTreeAnnotator(
        super.createBasicTreeAnnotator(),
        new KeyLookupTreeAnnotator(this, CompilerMessageKey.class));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy