Class SimpleAnnotationMirror

  • All Implemented Interfaces:
    javax.lang.model.element.AnnotationMirror

    public final class SimpleAnnotationMirror
    extends java.lang.Object
    implements javax.lang.model.element.AnnotationMirror
    A simple implementation of the AnnotationMirror interface.

    This type implements equals(Object) and hashCode() using AnnotationMirrors.equivalence() in accordance with the AnnotationMirror spec. Some AnnotationMirrors, however, do not correctly implement equals, you should always compare them using AnnotationMirrors.equivalence() anyway.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.lang.model.element.TypeElement annotationType  
      private com.google.common.collect.ImmutableMap<javax.lang.model.element.ExecutableElement,​? extends javax.lang.model.element.AnnotationValue> elementValues  
      private com.google.common.collect.ImmutableMap<java.lang.String,​? extends javax.lang.model.element.AnnotationValue> namedValues  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private SimpleAnnotationMirror​(javax.lang.model.element.TypeElement annotationType, java.util.Map<java.lang.String,​? extends javax.lang.model.element.AnnotationValue> namedValues)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      javax.lang.model.type.DeclaredType getAnnotationType()  
      java.util.Map<javax.lang.model.element.ExecutableElement,​? extends javax.lang.model.element.AnnotationValue> getElementValues()  
      int hashCode()  
      static javax.lang.model.element.AnnotationMirror of​(javax.lang.model.element.TypeElement annotationType)
      An object representing an annotation instance.
      static javax.lang.model.element.AnnotationMirror of​(javax.lang.model.element.TypeElement annotationType, java.util.Map<java.lang.String,​? extends javax.lang.model.element.AnnotationValue> namedValues)
      An object representing an annotation instance.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • annotationType

        private final javax.lang.model.element.TypeElement annotationType
      • namedValues

        private final com.google.common.collect.ImmutableMap<java.lang.String,​? extends javax.lang.model.element.AnnotationValue> namedValues
      • elementValues

        private final com.google.common.collect.ImmutableMap<javax.lang.model.element.ExecutableElement,​? extends javax.lang.model.element.AnnotationValue> elementValues
    • Constructor Detail

      • SimpleAnnotationMirror

        private SimpleAnnotationMirror​(javax.lang.model.element.TypeElement annotationType,
                                       java.util.Map<java.lang.String,​? extends javax.lang.model.element.AnnotationValue> namedValues)
    • Method Detail

      • of

        public static javax.lang.model.element.AnnotationMirror of​(javax.lang.model.element.TypeElement annotationType)
        An object representing an annotation instance. If annotationType has any annotation members, they must have default values.
      • of

        public static javax.lang.model.element.AnnotationMirror of​(javax.lang.model.element.TypeElement annotationType,
                                                                   java.util.Map<java.lang.String,​? extends javax.lang.model.element.AnnotationValue> namedValues)
        An object representing an annotation instance. If annotationType has any annotation members, they must either be present in namedValues or have default values.
      • getAnnotationType

        public javax.lang.model.type.DeclaredType getAnnotationType()
        Specified by:
        getAnnotationType in interface javax.lang.model.element.AnnotationMirror
      • getElementValues

        public java.util.Map<javax.lang.model.element.ExecutableElement,​? extends javax.lang.model.element.AnnotationValue> getElementValues()
        Specified by:
        getElementValues in interface javax.lang.model.element.AnnotationMirror
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object