Interface ModifiableCreator

All Superinterfaces:
AnnotatableCreator
All Known Subinterfaces:
AbstractMethodCreator, AnonymousClassCreator, ClassCreator, ConstructorCreator, ExecutableCreator, FieldCreator, InstanceExecutableCreator, InstanceFieldCreator, InstanceMethodCreator, InterfaceCreator, MemberCreator, MethodCreator, ParamCreator, StaticExecutableCreator, StaticFieldCreator, StaticMethodCreator, TypeCreator

public sealed interface ModifiableCreator extends AnnotatableCreator permits ExecutableCreator, MemberCreator, ParamCreator, TypeCreator (not exhaustive)
A creator for something which can have modifiers.
  • Method Details

    • modifierLocation

      ModifierLocation modifierLocation()
      Returns the modifier location constant for this creator (not null).
      Returns:
      the modifier location constant for this creator (not null)
    • addFlag

      void addFlag(ModifierFlag flag)
      Add the given modifier flag to this creator.
      Parameters:
      flag - the flag to add (must not be null)
      Throws:
      IllegalArgumentException - if this creator does not support the given flag
    • addFlags

      default void addFlags(Collection<ModifierFlag> flags)
      Add the given modifier flags to this creator.
      Parameters:
      flags - the flags to add (must not be null)
      Throws:
      IllegalArgumentException - if this creator does not support one of the given flags
    • addFlags

      default void addFlags(ModifierFlag... flags)
      Add the given modifier flags to this creator.
      Parameters:
      flags - the flags to add (must not be null)
      Throws:
      IllegalArgumentException - if this creator does not support one of the given flags
    • removeFlag

      void removeFlag(ModifierFlag flag)
      Remove the given modifier flag from this creator.
      Parameters:
      flag - the flag to remove (must not be null)
      Throws:
      IllegalArgumentException - if this creator does not support the given flag
    • removeFlags

      default void removeFlags(Collection<ModifierFlag> flags)
      Remove the given modifier flags from this creator.
      Parameters:
      flags - the flags to remove (must not be null)
      Throws:
      IllegalArgumentException - if this creator does not support one of the given flags
    • removeFlags

      default void removeFlags(ModifierFlag... flags)
      Remove the given modifier flags from this creator.
      Parameters:
      flags - the flags to remove (must not be null)
      Throws:
      IllegalArgumentException - if this creator does not support one of the given flags
    • supports

      default boolean supports(Modifier modifier)
      Returns true if the given modifier is supported by this creator, or false if it is not.
      Parameters:
      modifier - the modifier to test (must not be null)
      Returns:
      true if the given modifier is supported by this creator, or false if it is not
    • setAccess

      void setAccess(AccessLevel access)
      Set the access level of this creator.
      Parameters:
      access - the access level to set (must not be null)
      Throws:
      IllegalArgumentException - if this creator does not support the given access level
    • public_

      default void public_()
      Set the access level of this creator to public.
      Throws:
      IllegalArgumentException - if this creator does not support the public access level
    • protected_

      default void protected_()
      Set the access level of this creator to protected.
      Throws:
      IllegalArgumentException - if this creator does not support the protected access level
    • packagePrivate

      default void packagePrivate()
      Set the access level of this creator to package-private.
      Throws:
      IllegalArgumentException - if this creator does not support the package-private access level
    • private_

      default void private_()
      Set the access level of this creator to private.
      Throws:
      IllegalArgumentException - if this creator does not support the private access level
    • final_

      default void final_()
      Add the final modifier flag to this creator.
      Throws:
      IllegalArgumentException - if this creator does not support the final modifier flag
    • synthetic

      default void synthetic()
      Add the "synthetic" modifier flag to this creator.
      Throws:
      IllegalArgumentException - if this creator does not support the "synthetic" modifier flag