Class DefaultQualifierPolymorphism

    • Constructor Detail

      • DefaultQualifierPolymorphism

        public DefaultQualifierPolymorphism​(javax.annotation.processing.ProcessingEnvironment env,
                                            AnnotatedTypeFactory factory)
        Creates a DefaultQualifierPolymorphism instance that uses factory for querying type qualifiers and for getting annotated types.
        Parameters:
        env - the processing environment
        factory - the factory for the current checker
    • Method Detail

      • replace

        protected void replace​(AnnotatedTypeMirror type,
                               AnnotationMirrorMap<javax.lang.model.element.AnnotationMirror> replacements)
        Description copied from class: AbstractQualifierPolymorphism
        Replaces the top-level polymorphic annotations in type with the instantiations in replacements.

        This method is called on all parts of a type.

        Specified by:
        replace in class AbstractQualifierPolymorphism
        Parameters:
        type - the AnnotatedTypeMirror whose poly annotations are replaced; it is side-effected by this method
        replacements - a mapping from polymorphic annotation to instantiation
      • combine

        protected javax.lang.model.element.AnnotationMirror combine​(javax.lang.model.element.AnnotationMirror polyQual,
                                                                    javax.lang.model.element.AnnotationMirror a1,
                                                                    javax.lang.model.element.AnnotationMirror a2)
        This implementation combines the two annotations using the least upper bound.

        Returns annotation that is the combination of the two annotations. The annotations are instantiations for polyQual.

        The combination is typically their least upper bound. (It could be the GLB in the case that all arguments to a polymorphic method must have the same annotation.)

        Specified by:
        combine in class AbstractQualifierPolymorphism
        Parameters:
        polyQual - polymorphic qualifier for which a1 and a2 are instantiations
        a1 - an annotation that is an instantiation of polyQual
        a2 - an annotation that is an instantiation of polyQual
        Returns:
        an annotation that is the combination of the two annotations