Class AnnotationNode


  • public class AnnotationNode
    extends ASTNode
    Represents an annotation which can be attached to interfaces, classes, methods and fields.
    • Constructor Detail

      • AnnotationNode

        public AnnotationNode​(ClassNode classNode)
    • Method Detail

      • getClassNode

        public ClassNode getClassNode()
      • getMembers

        public java.util.Map<java.lang.String,​Expression> getMembers()
      • getMember

        public Expression getMember​(java.lang.String name)
      • addMember

        public void addMember​(java.lang.String name,
                              Expression value)
      • setMember

        public void setMember​(java.lang.String name,
                              Expression value)
      • isBuiltIn

        public boolean isBuiltIn()
      • hasRuntimeRetention

        public boolean hasRuntimeRetention()
        Flag corresponding to RetentionPolicy.
        Returns:
        true if the annotation should be visible at runtime, false otherwise
      • setRuntimeRetention

        public void setRuntimeRetention​(boolean flag)
        Sets the internal flag of this annotation runtime retention policy. If the current annotation has RetentionPolicy.RUNTIME or if false if the RetentionPolicy.CLASS.
        Parameters:
        flag - if true then current annotation is marked as having RetentionPolicy.RUNTIME. If false then the annotation has RetentionPolicy.CLASS.
      • hasSourceRetention

        public boolean hasSourceRetention()
        Flag corresponding to RetentionPolicy.SOURCE.
        Returns:
        true if the annotation is only allowed in sources false otherwise
      • setSourceRetention

        public void setSourceRetention​(boolean flag)
        Sets the internal flag if the current annotation has RetentionPolicy.SOURCE.
      • hasClassRetention

        public boolean hasClassRetention()
        Flag corresponding to RetentionPolicy.CLASS.
        Returns:
        true if the annotation is recorded by the compiler, but not visible at runtime * false otherwise
      • setClassRetention

        public void setClassRetention​(boolean flag)
        Sets the internal flag if the current annotation has RetentionPolicy.CLASS.
      • setAllowedTargets

        public void setAllowedTargets​(int bitmap)
      • isTargetAllowed

        public boolean isTargetAllowed​(int target)
      • targetToName

        public static java.lang.String targetToName​(int target)