Class AnnotableAndModifiableExtension
java.lang.Object
tools.mdsd.jamopp.model.java.extensions.modifiers.AnnotableAndModifiableExtension
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addModifier
(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 boolean
hasModifier
(AnnotableAndModifiable annotableAndModifiable, Class<?> type) Checks whether this element has an modifier of the given type.static boolean
isHidden
(AnnotableAndModifiable annotableAndModifiable, Commentable context) static boolean
isPrivate
(AnnotableAndModifiable annotableAndModifiable) static boolean
isProtected
(AnnotableAndModifiable annotableAndModifiable) static boolean
isPublic
(AnnotableAndModifiable annotableAndModifiable) static boolean
isStatic
(AnnotableAndModifiable annotableAndModifiable) Returnstrue
if this element is static (either by an explicit modifierstatic
or because this element is part of an interface).static void
makePrivate
(AnnotableAndModifiable annotableAndModifiable) Sets the visibility of this element toprivate
.static void
makeProtected
(AnnotableAndModifiable annotableAndModifiable) Sets the visibility of this element toprotected
.static void
makePublic
(AnnotableAndModifiable annotableAndModifiable) Sets the visibility of this element topublic
.static void
removeAllModifiers
(AnnotableAndModifiable annotableAndModifiable) Removes all modifiers from this element.static void
removeModifier
(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
Returnstrue
if this element is static (either by an explicit modifierstatic
or because this element is part of an interface). -
isHidden
-