Class AnnotableAndModifiableExtension

java.lang.Object
org.emftext.language.java.extensions.modifiers.AnnotableAndModifiableExtension

public class AnnotableAndModifiableExtension extends Object
  • Constructor Details

    • AnnotableAndModifiableExtension

      public AnnotableAndModifiableExtension()
  • Method Details

    • makePrivate

      public static void makePrivate(AnnotableAndModifiable me)
      Sets the visibility of this element to private.
      Parameters:
      me - this element.
    • makePublic

      public static void makePublic(AnnotableAndModifiable me)
      Sets the visibility of this element to public.
      Parameters:
      me - this element.
    • makeProtected

      public static void makeProtected(AnnotableAndModifiable me)
      Sets the visibility of this element to protected.
      Parameters:
      me - this element.
    • removeAllModifiers

      public static void removeAllModifiers(AnnotableAndModifiable me)
      Removes all modifiers from this element.
      Parameters:
      me - this element.
    • getModifiers

      public static EList<Modifier> getModifiers(AnnotableAndModifiable me)
      Returns an unmodifiable list of the modifiers that apply to this element.
      Parameters:
      me - this element.
      Returns:
      the modifiers.
    • getAnnotationInstances

      public static EList<AnnotationInstance> getAnnotationInstances(AnnotableAndModifiable me)
      Returns an unmodifiable list of the annotations that apply to this element.
      Parameters:
      me - this element.
      Returns:
      the annotations.
    • 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:
      me - this element.
      newModifier - the modifier to add
    • removeModifier

      public static void removeModifier(AnnotableAndModifiable me, Class<?> modifierType)
      Removes the given type of modifier from this element.
      Parameters:
      me - this element.
      modifierType - type of the modifier to remove.
    • 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:
      me - this element.
      type - type of the modifier.
      Returns:
      true or false.
    • isStatic

      public static boolean isStatic(AnnotableAndModifiable me)
      Returns true if this element is static (either by an explicit modifier static or because this element is part of an interface).
      Parameters:
      me - this element.
      Returns:
      true if this element is static. false otherwise.
    • isHidden

      public static boolean isHidden(AnnotableAndModifiable me, Commentable context)