Class DeclarationNameFilter
- java.lang.Object
-
- net.ssehub.easy.varModel.model.rewrite.modifier.DeclarationNameFilter
-
- All Implemented Interfaces:
IModelElementFilter<DecisionVariableDeclaration>
public class DeclarationNameFilter extends java.lang.Object implements IModelElementFilter<DecisionVariableDeclaration>
FiltersDecisionVariableDeclarations based on their names.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private booleanblacklistprivate java.util.Set<java.lang.String>declarationNames
-
Constructor Summary
Constructors Constructor Description DeclarationNameFilter(java.lang.String[] allowedNames)Default constructor for a whitelist based filtering.DeclarationNameFilter(java.lang.String[] declarationNames, boolean blacklist)Constructor which can be used for white or black list based filtering.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends ContainableModelElement>getModifyingModelClass()Specification for which kind of classes this may be applied to.ContainableModelElementhandleModelElement(ContainableModelElement element, RewriteContext context)Specification how to handleContainableModelElements.
-
-
-
Constructor Detail
-
DeclarationNameFilter
public DeclarationNameFilter(java.lang.String[] allowedNames)
Default constructor for a whitelist based filtering.- Parameters:
allowedNames- A whitelist of allowed names, others will be deleted.
-
DeclarationNameFilter
public DeclarationNameFilter(java.lang.String[] declarationNames, boolean blacklist)Constructor which can be used for white or black list based filtering.- Parameters:
declarationNames- Names which shall be filtered.blacklist- true the given names will be filtered out and all others will be kept (blacklist filtering), false the given names will be kept and all others will be filtered out (whitelist filtering).
-
-
Method Detail
-
getModifyingModelClass
public java.lang.Class<? extends ContainableModelElement> getModifyingModelClass()
Description copied from interface:IModelElementFilterSpecification for which kind of classes this may be applied to.- Specified by:
getModifyingModelClassin interfaceIModelElementFilter<DecisionVariableDeclaration>- Returns:
- The
ContainableModelElements which shall be modified by this class.
-
handleModelElement
public ContainableModelElement handleModelElement(ContainableModelElement element, RewriteContext context)
Description copied from interface:IModelElementFilterSpecification how to handleContainableModelElements.- Specified by:
handleModelElementin interfaceIModelElementFilter<DecisionVariableDeclaration>- Parameters:
element- AContainableModelElementwhich may be modified by this class.context- Knowledge of the current translation, comes from theProjectRewriteVisitor.- Returns:
- The modified element. Maybe the same instance as passed as parameter (if nothing should be changed) or null if the element should be deleted.
-
-