Class InjectAnnotationMirror

    • Field Detail

      • MIRROR_QUALIFIED_NAME

        public static final java.lang.String MIRROR_QUALIFIED_NAME
        See Also:
        Constant Field Values
      • annotationMirror

        private final javax.lang.model.element.AnnotationMirror annotationMirror
      • code

        private final java.lang.String code
      • type

        private final javax.lang.model.type.TypeMirror type
      • typeName

        private final java.lang.String typeName
      • ifPresent

        private final boolean ifPresent
      • deduplicationKey

        private final java.lang.String deduplicationKey
    • Constructor Detail

      • InjectAnnotationMirror

        private InjectAnnotationMirror​(javax.lang.model.element.TypeElement defaultAnnotationElement)
      • InjectAnnotationMirror

        private InjectAnnotationMirror​(javax.lang.model.element.AnnotationMirror annotationMirror)
    • Method Detail

      • mirrorQualifiedName

        public static java.lang.String mirrorQualifiedName()
      • qualifiedName

        public static java.lang.String qualifiedName()
      • simpleName

        public static java.lang.String simpleName()
      • isPresent

        public static boolean isPresent​(javax.lang.model.element.Element annotatedElement)
      • find

        public static com.google.common.base.Optional<InjectAnnotationMirror> find​(javax.lang.model.element.Element element)
        Finds first annotation of this type on the element.
        Parameters:
        element - annotated element
        Returns:
        optional InjectAnnotationMirror, present if this annotation found
      • find

        public static com.google.common.base.Optional<InjectAnnotationMirror> find​(java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> mirrors)
        Finds first annotation of this type in an iterable of annotation mirrors.
        Parameters:
        mirrors - annotation mirrors
        Returns:
        optional InjectAnnotationMirror, present if this annotation found
      • fromAll

        public static com.google.common.collect.ImmutableList<InjectAnnotationMirror> fromAll​(java.lang.Iterable<? extends javax.lang.model.element.AnnotationMirror> mirrors)
        Converts iterable of annotation mirrors where all annotation are of this type. Otherwise it fails
        Parameters:
        mirrors - of this annotation type.
        Returns:
        list of converted InjectAnnotationMirrors
      • from

        public static InjectAnnotationMirror from​(javax.lang.model.element.TypeElement element)
        Creates mirror with default values using annotation element (i.e. declaration, not usage).
        Parameters:
        element - annotation type element
        Returns:
        InjectAnnotationMirror
      • from

        public static com.google.common.base.Optional<InjectAnnotationMirror> from​(javax.lang.model.element.AnnotationMirror mirror)
        Tries to convert annotation mirror to this annotation type.
        Parameters:
        mirror - annotation mirror
        Returns:
        optional InjectAnnotationMirror, present if mirror matched this annotation type
      • code

        public java.lang.String code()
        Returns:
        value of attribute code
      • typeName

        public java.lang.String typeName()
        Returns:
        type name for value of attribute type
      • typeMirror

        public javax.lang.model.type.TypeMirror typeMirror()
        Returns:
        type mirror for value of attribute type
      • type

        @Deprecated
        public java.lang.Class<? extends java.lang.annotation.Annotation> type()
        Deprecated.
        Always throws UnsupportedOperationException. Use typeMirror() or typeName.
      • ifPresent

        public boolean ifPresent()
        Returns:
        value of attribute ifPresent
      • deduplicationKey

        public java.lang.String deduplicationKey()
        Returns:
        value of attribute deduplicationKey
      • getAnnotationMirror

        public javax.lang.model.element.AnnotationMirror getAnnotationMirror()
        Returns:
        underlying annotation mirror
      • annotationType

        public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
        Specified by:
        annotationType in interface java.lang.annotation.Annotation
        Returns:
        InjectAnnotation.class
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.lang.annotation.Annotation
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Specified by:
        equals in interface java.lang.annotation.Annotation
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.annotation.Annotation
        Overrides:
        toString in class java.lang.Object