Class AnnotableAndModifiableExtension
- java.lang.Object
-
- org.emftext.language.java.extensions.modifiers.AnnotableAndModifiableExtension
-
public class AnnotableAndModifiableExtension extends Object
-
-
Constructor Summary
Constructors Constructor Description AnnotableAndModifiableExtension()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addModifier(AnnotableAndModifiable me, Modifier newModifier)
Adds the given type of modifier to this element.static EList<AnnotationInstance>
getAnnotationInstances(AnnotableAndModifiable me)
Returns an unmodifiable list of the annotations that apply to this element.static EList<Modifier>
getModifiers(AnnotableAndModifiable me)
Returns an unmodifiable list of the modifiers that apply to this element.static boolean
hasModifier(AnnotableAndModifiable me, Class<?> type)
Checks whether this element has an modifier of the given type.static boolean
isHidden(AnnotableAndModifiable me, Commentable context)
static boolean
isPrivate(AnnotableAndModifiable me)
static boolean
isProtected(AnnotableAndModifiable me)
static boolean
isPublic(AnnotableAndModifiable me)
static boolean
isStatic(AnnotableAndModifiable me)
Returnstrue
if this element is static (either by an explicit modifierstatic
or because this element is part of an interface).static void
makePrivate(AnnotableAndModifiable me)
Sets the visibility of this element toprivate
.static void
makeProtected(AnnotableAndModifiable me)
Sets the visibility of this element toprotected
.static void
makePublic(AnnotableAndModifiable me)
Sets the visibility of this element topublic
.static void
removeAllModifiers(AnnotableAndModifiable me)
Removes all modifiers from this element.static void
removeModifier(AnnotableAndModifiable me, Class<?> modifierType)
Removes the given type of modifier from this element.
-
-
-
Method Detail
-
makePrivate
public static void makePrivate(AnnotableAndModifiable me)
Sets the visibility of this element toprivate
.
-
makePublic
public static void makePublic(AnnotableAndModifiable me)
Sets the visibility of this element topublic
.
-
makeProtected
public static void makeProtected(AnnotableAndModifiable me)
Sets the visibility of this element toprotected
.
-
removeAllModifiers
public static void removeAllModifiers(AnnotableAndModifiable me)
Removes all modifiers from this element.
-
getModifiers
public static EList<Modifier> getModifiers(AnnotableAndModifiable me)
Returns an unmodifiable list of the modifiers that apply to this element.
-
getAnnotationInstances
public static EList<AnnotationInstance> getAnnotationInstances(AnnotableAndModifiable me)
Returns an unmodifiable list of the annotations that apply to this element.
-
addModifier
public static void addModifier(AnnotableAndModifiable me, Modifier newModifier)
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 me, Class<?> modifierType)
Removes the given type of modifier from this element.- Parameters:
modifierType
-
-
isPublic
public static boolean isPublic(AnnotableAndModifiable me)
-
isPrivate
public static boolean isPrivate(AnnotableAndModifiable me)
-
isProtected
public static boolean isProtected(AnnotableAndModifiable me)
-
hasModifier
public static boolean hasModifier(AnnotableAndModifiable me, Class<?> type)
Checks whether this element has an modifier of the given type.- Parameters:
type
-
-
isStatic
public static boolean isStatic(AnnotableAndModifiable me)
Returnstrue
if this element is static (either by an explicit modifierstatic
or because this element is part of an interface).
-
isHidden
public static boolean isHidden(AnnotableAndModifiable me, Commentable context)
-
-