Class AppliedAnnotationObject.BuilderMF

Direct Known Subclasses:
NamePropertyApplyAnnotation.Builder, ParentPropertyApplyAnnotation.Builder
Enclosing class:
AppliedAnnotationObject

Builder for applied annotations targeting methods and fields.

Adds method and field targeting capabilities to the base builder:

Example:

// Target specific methods and fields Method method = MyClass.class.getMethod("myMethod"); Field field = MyClass.class.getField("myField"); MyAnnotation annotation = MyAnnotation .create() .on(method) .on(field) .build();

  • Constructor Details

    • BuilderMF

      public BuilderMF(Class<? extends Annotation> annotationType)
      Constructor.
      Parameters:
      annotationType - The annotation type of the annotation implementation class. Must not be null.
  • Method Details

    • on

      Appends the fields that this annotation applies to.
      Parameters:
      value - The values to append. Cannot be null or contain null elements.
      Returns:
      This object.
    • on

      Appends the fields that this annotation applies to.
      Parameters:
      value - The values to append. Cannot be null or contain null elements.
      Returns:
      This object.
    • on

      Appends the methods that this annotation applies to.
      Parameters:
      value - The values to append. Cannot be null or contain null elements.
      Returns:
      This object.
    • on

      Appends the methods that this annotation applies to.
      Parameters:
      value - The values to append. Cannot be null or contain null elements.
      Returns:
      This object.