コード例 #1
0
  public UnitsAnnotatedTypeFormatter(BaseTypeChecker checker) {
    // Utilize the Default Type Formatter, but force it to print out Invisible Qualifiers
    // keep super call in sync with implementation in DefaultAnnotatedTypeFormatter
    // keep checker options in sync with implementation in AnnotatedTypeFactory
    super(
        new UnitsFormattingVisitor(
            checker,
            new UnitsAnnotationFormatter(checker),
            checker.hasOption("printVerboseGenerics"),
            true));

    this.checker = checker;
    this.elements = checker.getElementUtils();
  }
コード例 #2
0
    public UnitsFormattingVisitor(
        BaseTypeChecker checker,
        AnnotationFormatter annoFormatter,
        boolean printVerboseGenerics,
        boolean defaultInvisiblesSetting) {

      super(annoFormatter, printVerboseGenerics, defaultInvisiblesSetting);
      this.checker = checker;
      this.elements = checker.getElementUtils();
    }
コード例 #3
0
  public NullnessVisitor(BaseTypeChecker checker, boolean useFbc) {
    super(checker);

    NONNULL = atypeFactory.NONNULL;
    NULLABLE = atypeFactory.NULLABLE;
    MONOTONIC_NONNULL = atypeFactory.MONOTONIC_NONNULL;
    stringType = elements.getTypeElement("java.lang.String").asType();

    ProcessingEnvironment env = checker.getProcessingEnvironment();
    this.collectionSize = TreeUtils.getMethod(java.util.Collection.class.getName(), "size", 0, env);
    this.collectionToArray =
        TreeUtils.getMethod(java.util.Collection.class.getName(), "toArray", 1, env);

    checkForAnnotatedJdk();
  }
コード例 #4
0
 public UnitsAnnotationFormatter(BaseTypeChecker checker) {
   this.checker = checker;
   this.elements = checker.getElementUtils();
 }