Class AnnotableAndModifiableExtension
java.lang.Object
tools.mdsd.jamopp.model.java.extensions.modifiers.AnnotableAndModifiableExtension
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddModifier(AnnotableAndModifiable annotableAndModifiable, Modifier newModifier) Adds the given type of modifier to this element.static EList<AnnotationInstance>getAnnotationInstances(AnnotableAndModifiable annotableAndModifiable) Returns an unmodifiable list of the annotations that apply to this element.getModifiers(AnnotableAndModifiable annotableAndModifiable) Returns an unmodifiable list of the modifiers that apply to this element.static booleanhasModifier(AnnotableAndModifiable annotableAndModifiable, Class<?> type) Checks whether this element has an modifier of the given type.static booleanisHidden(AnnotableAndModifiable annotableAndModifiable, Commentable context) static booleanisPrivate(AnnotableAndModifiable annotableAndModifiable) static booleanisProtected(AnnotableAndModifiable annotableAndModifiable) static booleanisPublic(AnnotableAndModifiable annotableAndModifiable) static booleanisStatic(AnnotableAndModifiable annotableAndModifiable) Returnstrueif this element is static (either by an explicit modifierstaticor because this element is part of an interface).static voidmakePrivate(AnnotableAndModifiable annotableAndModifiable) Sets the visibility of this element toprivate.static voidmakeProtected(AnnotableAndModifiable annotableAndModifiable) Sets the visibility of this element toprotected.static voidmakePublic(AnnotableAndModifiable annotableAndModifiable) Sets the visibility of this element topublic.static voidremoveAllModifiers(AnnotableAndModifiable annotableAndModifiable) Removes all modifiers from this element.static voidremoveModifier(AnnotableAndModifiable annotableAndModifiable, Class<?> modifierType) Removes the given type of modifier from this element.
-
Method Details
-
makePrivate
Sets the visibility of this element toprivate. -
makePublic
Sets the visibility of this element topublic. -
makeProtected
Sets the visibility of this element toprotected. -
removeAllModifiers
Removes all modifiers from this element. -
getModifiers
Returns an unmodifiable list of the modifiers that apply to this element. -
getAnnotationInstances
public static EList<AnnotationInstance> getAnnotationInstances(AnnotableAndModifiable annotableAndModifiable) Returns an unmodifiable list of the annotations that apply to this element. -
addModifier
Adds the given type of modifier to this element. This method does not check for duplicate modifiers!- Parameters:
newModifier- the modifier to add
-
removeModifier
public static void removeModifier(AnnotableAndModifiable annotableAndModifiable, Class<?> modifierType) Removes the given type of modifier from this element.- Parameters:
modifierType-
-
isPublic
-
isPrivate
-
isProtected
-
hasModifier
Checks whether this element has an modifier of the given type.- Parameters:
type-
-
isStatic
Returnstrueif this element is static (either by an explicit modifierstaticor because this element is part of an interface). -
isHidden
-