Class DefaultQualifierForUseTypeAnnotator

    • Field Detail

      • elementToDefaults

        protected final java.util.Map<javax.lang.model.element.Element,​AnnotationMirrorSet> elementToDefaults
        Cache of elements to the set of annotations that should be applied to unannotated uses of the element.
    • Constructor Detail

      • DefaultQualifierForUseTypeAnnotator

        public DefaultQualifierForUseTypeAnnotator​(AnnotatedTypeFactory typeFactory)
        Creates an DefaultQualifierForUseTypeAnnotator for typeFactory.
        Parameters:
        typeFactory - the type factory
    • Method Detail

      • clearCache

        public void clearCache()
        Clears all caches.
      • getDefaultAnnosForUses

        protected AnnotationMirrorSet getDefaultAnnosForUses​(javax.lang.model.element.Element element)
        Returns the set of qualifiers that should be applied to unannotated uses of the given element
        Parameters:
        element - the element for which to determine default qualifiers
        Returns:
        the set of qualifiers that should be applied to unannotated uses of element
      • getExplicitAnnos

        protected AnnotationMirrorSet getExplicitAnnos​(javax.lang.model.element.Element element)
        Return the annotations explicitly written on the element.
        Parameters:
        element - an element
        Returns:
        the annotations explicitly written on the element
      • getDefaultQualifierForUses

        protected AnnotationMirrorSet getDefaultQualifierForUses​(javax.lang.model.element.Element element)
        Return the default qualifiers for uses of element as specified by a DefaultQualifierForUse annotation.

        Subclasses may override to use an annotation other than DefaultQualifierForUse.

        Parameters:
        element - an element
        Returns:
        the default qualifiers for uses of element
      • getHierarchiesNoDefault

        protected AnnotationMirrorSet getHierarchiesNoDefault​(javax.lang.model.element.Element element)
        Returns top annotations in hierarchies for which no default for use qualifier should be added.
        Parameters:
        element - an element
        Returns:
        top annotations in hierarchies for which no default for use qualifier should be added
      • supportedAnnosFromAnnotationMirror

        protected final AnnotationMirrorSet supportedAnnosFromAnnotationMirror​(java.util.List<@CanonicalName javax.lang.model.element.Name> annoClassNames)
        Returns the set of qualifiers supported by this type system from the value element of annotationMirror.
        Parameters:
        annoClassNames - a list of annotation class names
        Returns:
        the set of qualifiers supported by this type system from the value element of annotationMirror