Interface AnnotationMaker


public interface AnnotationMaker
Defines the contents of an annotation.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    newAnnotation(Object annotationType)
    Define a new annotation, which can be put into this annotation at most once.
    void
    put(String name, Object value)
    Put a name-value pair into the annotation, where the value can be a primitive type, a String, an Enum, a Class, an AnnotationMaker, or an array.
  • Method Details

    • put

      void put(String name, Object value)
      Put a name-value pair into the annotation, where the value can be a primitive type, a String, an Enum, a Class, an AnnotationMaker, or an array.
      Parameters:
      name - annotation element name
      value - annotation element value
      Throws:
      IllegalArgumentException - if value is unsupported
      IllegalStateException - if name is already in this annotation
      IllegalStateException - if value is an incorrectly used AnnotationMaker
    • newAnnotation

      AnnotationMaker newAnnotation(Object annotationType)
      Define a new annotation, which can be put into this annotation at most once.
      Parameters:
      annotationType - name or class which refers to an annotation interface
      Throws:
      IllegalArgumentException - if the annotation type is unsupported