Class CommentableExtension

java.lang.Object
tools.mdsd.jamopp.model.java.extensions.commons.CommentableExtension

public final class CommentableExtension extends Object
  • Method Details

    • addBeforeContainingStatement

      public static void addBeforeContainingStatement(Commentable commentable, Statement statementToAdd)
      Adds the given statement before the statement that contains this element.
    • addAfterContainingStatement

      public static void addAfterContainingStatement(Commentable commentable, Statement statementToAdd)
      Adds the given statement after the statement that contains this element.
    • getParentByEType

      public static EObject getParentByEType(EObject eObject, EClassifier type)
      Walks up the containment hierarchy and returns the first parent with the given type. If no such parent is found, null is returned.
    • getParentByType

      public static <T> T getParentByType(EObject eObject, Class<T> type)
      Walks up the containment hierarchy and returns the first parent with the given type. If no such parent is found, null is returned.
    • getFirstChildByEType

      public static EObject getFirstChildByEType(EObject eObject, EClassifier type)
      Searches for the first child with the given type. If no such child is found, null is returned.
    • getFirstChildByType

      public static <T> T getFirstChildByType(EObject eObject, Class<T> type)
      Searches for the first child with the given type. If no such child is found, null is returned.
    • getChildrenByEType

      public static EList<EObject> getChildrenByEType(EObject eObject, EClassifier type)
      Returns all children of the given type.
    • getChildrenByType

      public static <T> EList<T> getChildrenByType(EObject eObject, Class<T> type)
      Returns all children of the given type.
    • getConcreteClassifier

      public static ConcreteClassifier getConcreteClassifier(Commentable commentable, String name)
      Finds the ConcreteClassifier representing the class with the given classified name.
      Parameters:
      commentable - unused
      name - classified name of the ConcreteClassifier
    • getConcreteClassifiers

      public static EList<ConcreteClassifier> getConcreteClassifiers(Commentable commentable, String packageName, String classifierQuery)
      Finds all ConcreteClassifier representing the classes in the given package or a single class from that package.
      Parameters:
      commentable - unused
      packageName - name of the package
      classifierQuery - * for all classifiers or name of a single classifier
    • getLibClass

      public static Class getLibClass(Commentable commentable, String name)
      Finds the Class representing the class with the given name located in java.lang.
      Parameters:
      commentable - unused
      name - name of the Class.
      Returns:
      the Class.
    • getLibInterface

      public static Interface getLibInterface(Commentable commentable, String name)
      Finds the Interface representing the interface with the given name located in java.lang.
      Parameters:
      commentable - unused
      name - name of the Interface.
      Returns:
      the interface.
    • getClassClass

      public static Class getClassClass(Commentable commentabke)
      Finds the Class representing java.lang.Class.
      Returns:
      the Class.
    • getObjectClass

      public static Class getObjectClass(Commentable commentable)
      Finds the Class representing java.lang.Object.
      Returns:
      the Class.
    • getStringClass

      public static Class getStringClass(Commentable commentable)
      Finds the Class representing java.lang.String.
      Returns:
      the Class.
    • getAnnotationInterface

      public static Interface getAnnotationInterface(Commentable commentable)
      Finds the Interface representing java.lang.annotation.Annotation.
      Parameters:
      commentable - unused
      Returns:
      the Class.
    • getContainingConcreteClassifier

      public static ConcreteClassifier getContainingConcreteClassifier(Commentable commentable)
      Finds the containing classifier for the given element.
      Parameters:
      value -
      Returns:
      containing classifier
    • getParentConcreteClassifier

      public static ConcreteClassifier getParentConcreteClassifier(Commentable commentable)
      Finds the classifier that is the parent of this element. If this element is an inner classifier the parent classifier does not necessarily contain this element, since it can reside in a different compilation unit when stored in byte code.
      Returns:
      containing classifier
    • getContainingAnonymousClass

      public static AnonymousClass getContainingAnonymousClass(Commentable commentable)
      Finds the containing anonymous class for the given element.
      Returns:
      containing anonymous class
    • getContainingCompilationUnit

      public static CompilationUnit getContainingCompilationUnit(Commentable commentable)
      Finds the containing compilation unit for the given element.
      Returns:
      containing compilation unit
    • getContainingAnnotationInstance

      public static AnnotationInstance getContainingAnnotationInstance(Commentable commentable)
      Finds the containing annotation instance for the given element.
      Returns:
      containing annotation instance
    • getContainingPackageName

      public static EList<String> getContainingPackageName(Commentable commentable)
    • getContainingContainerName

      public static EList<String> getContainingContainerName(Commentable commentable)