java.lang.Object
org.palladiosimulator.retriever.extraction.engine.RuleHelper

public class RuleHelper extends Object
This class is used as a supporting library for writing rules for Retriever. It contains numerous methods to query a certain state of a java model instance. For example, is a class is annotated with a specific annotation name. Also the helper contains methods for retrieving aspects of a class like the interfaces it is implementing.
  • Constructor Details

    • RuleHelper

      public RuleHelper()
  • Method Details

    • getUnitName

      public static String getUnitName(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • isAbstraction

      public static boolean isAbstraction(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • isUnitAnnotatedWithName

      public static boolean isUnitAnnotatedWithName(org.eclipse.jdt.core.dom.CompilationUnit unit, String... names)
    • isObjectAnnotatedWithName

      public static boolean isObjectAnnotatedWithName(org.eclipse.jdt.core.dom.BodyDeclaration body, String name)
    • isObjectAnnotatedWithName

      public static boolean isObjectAnnotatedWithName(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter, String name)
    • isObjectAnnotatedWithName

      public static boolean isObjectAnnotatedWithName(org.eclipse.jdt.core.dom.TypeParameter parameter, String name)
    • isObjectAnnotatedWithName

      public static boolean isObjectAnnotatedWithName(org.eclipse.jdt.core.dom.VariableDeclarationExpression expression, String name)
    • isObjectAnnotatedWithName

      public static boolean isObjectAnnotatedWithName(org.eclipse.jdt.core.dom.VariableDeclarationStatement statement, String name)
    • isClassifierAnnotatedWithName

      public static boolean isClassifierAnnotatedWithName(org.eclipse.jdt.core.dom.BodyDeclaration abstTypeDecl, String name)
    • getMethods

      public static List<org.eclipse.jdt.core.dom.MethodDeclaration> getMethods(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • getMethods

      public static List<org.eclipse.jdt.core.dom.MethodDeclaration> getMethods(org.eclipse.jdt.core.dom.TypeDeclaration type)
    • getMethods

      public static List<org.eclipse.jdt.core.dom.IMethodBinding> getMethods(org.eclipse.jdt.core.dom.Type type)
    • getFields

      public static List<org.eclipse.jdt.core.dom.FieldDeclaration> getFields(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • getParameters

      public static List<org.eclipse.jdt.core.dom.SingleVariableDeclaration> getParameters(org.eclipse.jdt.core.dom.MethodDeclaration method)
    • isMethodAnnotatedWithName

      public static boolean isMethodAnnotatedWithName(org.eclipse.jdt.core.dom.MethodDeclaration method, String... names)
    • isFieldAbstract

      public static boolean isFieldAbstract(org.eclipse.jdt.core.dom.FieldDeclaration field)
    • isParameterAbstract

      public static boolean isParameterAbstract(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter)
    • isParameterAClassAnnotatedWith

      public static boolean isParameterAClassAnnotatedWith(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter, String... names)
    • isFieldModifiedExactlyWith

      public static boolean isFieldModifiedExactlyWith(org.eclipse.jdt.core.dom.BodyDeclaration field, String... names)
    • isParameterAnnotatedWith

      public static boolean isParameterAnnotatedWith(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter, String name)
    • isUnitNamedWith

      public static boolean isUnitNamedWith(org.eclipse.jdt.core.dom.CompilationUnit unit, String name)
    • isUnitAnEnum

      public static boolean isUnitAnEnum(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • getAllAbstractParents

      public static List<org.eclipse.jdt.core.dom.Type> getAllAbstractParents(org.eclipse.jdt.core.dom.CompilationUnit unit)
      Returns everything listed after "implements" and "extends" in the type declaration that is either abstract or an interface.
    • isFieldAnnotatedWithName

      public static boolean isFieldAnnotatedWithName(org.eclipse.jdt.core.dom.BodyDeclaration field, String name)
    • isClassImplementing

      public static boolean isClassImplementing(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • isImplementingOrExtending

      public static boolean isImplementingOrExtending(org.eclipse.jdt.core.dom.CompilationUnit unit, String ifaceName)
    • isImplementingOrExtending

      public static boolean isImplementingOrExtending(org.eclipse.jdt.core.dom.ITypeBinding binding, String ifaceName)
    • isClassExtending

      public static boolean isClassExtending(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • getExtends

      public static org.eclipse.jdt.core.dom.Type getExtends(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • isClassModifiedExactlyWith

      public static boolean isClassModifiedExactlyWith(org.eclipse.jdt.core.dom.CompilationUnit unit, String... names)
    • isMethodModifiedExactlyWith

      public static boolean isMethodModifiedExactlyWith(org.eclipse.jdt.core.dom.BodyDeclaration method, String... names)
    • getAllPublicMethods

      public static List<org.eclipse.jdt.core.dom.MethodDeclaration> getAllPublicMethods(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • getConstructors

      public static List<org.eclipse.jdt.core.dom.MethodDeclaration> getConstructors(org.eclipse.jdt.core.dom.CompilationUnit unit)
    • isConstructorAnnotatedWithName

      public static boolean isConstructorAnnotatedWithName(org.eclipse.jdt.core.dom.MethodDeclaration constructor, String name)
    • isClassOfFieldAnnotatedWithName

      public static boolean isClassOfFieldAnnotatedWithName(org.eclipse.jdt.core.dom.FieldDeclaration field, String... names)
    • getMethodAnnotationStringValue

      public static String getMethodAnnotationStringValue(org.eclipse.jdt.core.dom.MethodDeclaration method, String annotation)
    • getMethodAnnotationStringValue

      public static String getMethodAnnotationStringValue(org.eclipse.jdt.core.dom.MethodDeclaration method, String annotationName, String memberName)
    • getUnitAnnotationStringValue

      public static String getUnitAnnotationStringValue(org.eclipse.jdt.core.dom.CompilationUnit unit, String annotation)
    • getUnitAnnotationStringValue

      public static String getUnitAnnotationStringValue(org.eclipse.jdt.core.dom.CompilationUnit unit, String annotationName, String memberName)