Class RuleHelper
java.lang.Object
org.palladiosimulator.retriever.extraction.engine.RuleHelper
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static List<org.eclipse.jdt.core.dom.MethodDeclaration>
getAllPublicMethods
(org.eclipse.jdt.core.dom.CompilationUnit unit) static List<org.eclipse.jdt.core.dom.MethodDeclaration>
getConstructors
(org.eclipse.jdt.core.dom.CompilationUnit unit) static org.eclipse.jdt.core.dom.Type
getExtends
(org.eclipse.jdt.core.dom.CompilationUnit unit) static List<org.eclipse.jdt.core.dom.FieldDeclaration>
getFields
(org.eclipse.jdt.core.dom.CompilationUnit unit) static String
getMethodAnnotationStringValue
(org.eclipse.jdt.core.dom.MethodDeclaration method, String annotation) static String
getMethodAnnotationStringValue
(org.eclipse.jdt.core.dom.MethodDeclaration method, String annotationName, String memberName) static List<org.eclipse.jdt.core.dom.MethodDeclaration>
getMethods
(org.eclipse.jdt.core.dom.CompilationUnit unit) static List<org.eclipse.jdt.core.dom.IMethodBinding>
getMethods
(org.eclipse.jdt.core.dom.Type type) static List<org.eclipse.jdt.core.dom.MethodDeclaration>
getMethods
(org.eclipse.jdt.core.dom.TypeDeclaration type) static List<org.eclipse.jdt.core.dom.SingleVariableDeclaration>
getParameters
(org.eclipse.jdt.core.dom.MethodDeclaration method) static String
getUnitAnnotationStringValue
(org.eclipse.jdt.core.dom.CompilationUnit unit, String annotation) static String
getUnitAnnotationStringValue
(org.eclipse.jdt.core.dom.CompilationUnit unit, String annotationName, String memberName) static String
getUnitName
(org.eclipse.jdt.core.dom.CompilationUnit unit) static boolean
isAbstraction
(org.eclipse.jdt.core.dom.CompilationUnit unit) static boolean
isClassExtending
(org.eclipse.jdt.core.dom.CompilationUnit unit) static boolean
isClassifierAnnotatedWithName
(org.eclipse.jdt.core.dom.BodyDeclaration abstTypeDecl, String name) static boolean
isClassImplementing
(org.eclipse.jdt.core.dom.CompilationUnit unit) static boolean
isClassModifiedExactlyWith
(org.eclipse.jdt.core.dom.CompilationUnit unit, String... names) static boolean
isClassOfFieldAnnotatedWithName
(org.eclipse.jdt.core.dom.FieldDeclaration field, String... names) static boolean
isConstructorAnnotatedWithName
(org.eclipse.jdt.core.dom.MethodDeclaration constructor, String name) static boolean
isFieldAbstract
(org.eclipse.jdt.core.dom.FieldDeclaration field) static boolean
isFieldAnnotatedWithName
(org.eclipse.jdt.core.dom.BodyDeclaration field, String name) static boolean
isFieldModifiedExactlyWith
(org.eclipse.jdt.core.dom.BodyDeclaration field, String... names) static boolean
isImplementingOrExtending
(org.eclipse.jdt.core.dom.CompilationUnit unit, String ifaceName) static boolean
isImplementingOrExtending
(org.eclipse.jdt.core.dom.ITypeBinding binding, String ifaceName) static boolean
isMethodAnnotatedWithName
(org.eclipse.jdt.core.dom.MethodDeclaration method, String... names) static boolean
isMethodModifiedExactlyWith
(org.eclipse.jdt.core.dom.BodyDeclaration method, String... names) static boolean
isObjectAnnotatedWithName
(org.eclipse.jdt.core.dom.BodyDeclaration body, String name) static boolean
isObjectAnnotatedWithName
(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter, String name) static boolean
isObjectAnnotatedWithName
(org.eclipse.jdt.core.dom.TypeParameter parameter, String name) static boolean
isObjectAnnotatedWithName
(org.eclipse.jdt.core.dom.VariableDeclarationExpression expression, String name) static boolean
isObjectAnnotatedWithName
(org.eclipse.jdt.core.dom.VariableDeclarationStatement statement, String name) static boolean
isParameterAbstract
(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter) static boolean
isParameterAClassAnnotatedWith
(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter, String... names) static boolean
isParameterAnnotatedWith
(org.eclipse.jdt.core.dom.SingleVariableDeclaration parameter, String name) static boolean
isUnitAnEnum
(org.eclipse.jdt.core.dom.CompilationUnit unit) static boolean
isUnitAnnotatedWithName
(org.eclipse.jdt.core.dom.CompilationUnit unit, String... names) static boolean
isUnitNamedWith
(org.eclipse.jdt.core.dom.CompilationUnit unit, String name)
-
Constructor Details
-
RuleHelper
public RuleHelper()
-
-
Method Details
-
getUnitName
-
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
-
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
-
getMethodAnnotationStringValue
-
getUnitAnnotationStringValue
-
getUnitAnnotationStringValue
-