Interface CtModifiable

All Superinterfaces:
Cloneable, CtElement, CtQueryable, CtVisitable, FactoryAccessor, Serializable, SourcePositionHolder
All Known Subinterfaces:
CtAnnotationMethod<T>, CtAnnotationType<T>, CtAnonymousExecutable, CtCatchVariable<T>, CtClass<T>, CtConstructor<T>, CtEnum<T>, CtEnumValue<T>, CtField<T>, CtFormalTypeDeclarer, CtInterface<T>, CtLocalVariable<T>, CtMethod<T>, CtParameter<T>, CtRecord, CtResource<T>, CtType<T>, CtTypeMember, CtTypeParameter, CtVariable<T>
All Known Implementing Classes:
CtAnnotationMethodImpl, CtAnnotationTypeImpl, CtAnonymousExecutableImpl, CtCatchVariableImpl, CtClassImpl, CtConstructorImpl, CtEnumImpl, CtEnumValueImpl, CtFieldImpl, CtInterfaceImpl, CtLocalVariableImpl, CtMethodImpl, CtParameterImpl, CtRecordImpl, CtTypeImpl, CtTypeParameterImpl, InvisibleArrayConstructorImpl

public interface CtModifiable extends CtElement
This interface defines an element that accepts modifiers.
  • Method Details

    • getModifiers

      Set<ModifierKind> getModifiers()
      Returns the modifiers of this element, excluding annotations. Implicit modifiers, such as the public and static modifiers of interface members, are included.
      Returns:
      the modifiers of this declaration in undefined order; an empty set if there are none
    • hasModifier

      boolean hasModifier(ModifierKind modifier)
      Tells if this element contains the given modifier.
      Parameters:
      modifier - to search
      Returns:
      true if this element contain the modifier
    • setModifiers

      <T extends CtModifiable> T setModifiers(Set<ModifierKind> modifiers)
      Sets the modifiers.
    • addModifier

      <T extends CtModifiable> T addModifier(ModifierKind modifier)
      add a modifier
      Parameters:
      modifier -
    • removeModifier

      <T extends CtModifiable> T removeModifier(ModifierKind modifier)
      remove a modifier
      Parameters:
      modifier -
    • setVisibility

      <T extends CtModifiable> T setVisibility(ModifierKind visibility)
      Sets the visibility of this modifiable element (replaces old visibility).
    • getVisibility

      ModifierKind getVisibility()
      Gets the visibility of this modifiable element.
    • getExtendedModifiers

      Set<CtExtendedModifier> getExtendedModifiers()
      Returns:
      the set of extended modifiers (those incl. implicit).
    • setExtendedModifiers

      <T extends CtModifiable> T setExtendedModifiers(Set<CtExtendedModifier> extendedModifiers)
    • isPublic

      boolean isPublic()
      Returns true if it contains a public modifier (see hasModifier(ModifierKind))
    • isFinal

      boolean isFinal()
      Returns true if it contains a final modifier (see hasModifier(ModifierKind))
    • isStatic

      boolean isStatic()
      Returns true if it contains a static modifier (see hasModifier(ModifierKind))
    • isProtected

      boolean isProtected()
      Returns true if it contains a protected modifier (see hasModifier(ModifierKind))
    • isPrivate

      boolean isPrivate()
      Returns true if it contains a private modifier (see hasModifier(ModifierKind))
    • isAbstract

      boolean isAbstract()
      Returns true if it contains an abstract modifier (see hasModifier(ModifierKind))
    • isTransient

      boolean isTransient()
      Returns true if it contains a transient modifier (see hasModifier(ModifierKind))
    • isVolatile

      boolean isVolatile()
      Returns true if it contains a volatile modifier (see hasModifier(ModifierKind))
    • isSynchronized

      boolean isSynchronized()
      Returns true if it contains a synchronized modifier (see hasModifier(ModifierKind))
    • isNative

      boolean isNative()
      Returns true if it contains a native modifier (see hasModifier(ModifierKind))
    • isStrictfp

      boolean isStrictfp()
      Returns true if it contains a strictfp modifier (see hasModifier(ModifierKind))