Class AnnotationFileParser.RecordComponentStub

  • Enclosing class:
    AnnotationFileParser

    public static class AnnotationFileParser.RecordComponentStub
    extends java.lang.Object
    Information about a record component: its type, and whether there was an accessor in the stubs for that component. That is, for a component "foo" was there a method named exactly "foo()" in the stubs. If so, annotations on that accessor will take precedence over annotations that would otherwise be copied from the component in the stubs to the acessor.
    • Constructor Detail

      • RecordComponentStub

        public RecordComponentStub​(AnnotatedTypeMirror type,
                                   AnnotationMirrorSet allAnnotations)
        Creates a new RecordComponentStub with the given type.
        Parameters:
        type - the type of the record component
        allAnnotations - the declaration annotations on the component
    • Method Detail

      • getAnnotationsForTarget

        public AnnotationMirrorSet getAnnotationsForTarget​(javax.lang.model.element.ElementKind elementKind)
        Get the record component annotations that are applicable to the given element kind.
        Parameters:
        elementKind - the element kind to apply to (e.g., FIELD, METHOD)
        Returns:
        the set of annotations from the component that apply
      • hasAccessorInStubs

        public boolean hasAccessorInStubs()
        Returns whether there is an accessor in a stub file.
        Returns:
        true if some stub file contains an accessor for this record component