Class ImportNameFilter
java.lang.Object
net.ssehub.easy.varModel.model.rewrite.modifier.ImportNameFilter
- All Implemented Interfaces:
IProjectImportFilter
Filters
ProjectImports based on their names.- Author:
- El-Sharkawy
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionImportNameFilter(String[] allowedNames) Default constructor for a whitelist based filtering.ImportNameFilter(String[] declarationNames, boolean blacklist) Constructor which can be used for white or black list based filtering. -
Method Summary
Modifier and TypeMethodDescriptionhandleImport(ProjectImport element, RewriteContext context) Specification how to handleProjectImports.
-
Field Details
-
projectNames
-
blacklist
private boolean blacklist
-
-
Constructor Details
-
ImportNameFilter
Default constructor for a whitelist based filtering.- Parameters:
allowedNames- A whitelist of allowed names, others will be deleted.
-
ImportNameFilter
Constructor which can be used for white or black list based filtering.- Parameters:
declarationNames- Names which shall be filtered.blacklist-truethe given names will be filtered out and all others will be kept (blacklist filtering),falsethe given names will be kept and all others will be filtered out (whitelist filtering).
-
-
Method Details
-
handleImport
Description copied from interface:IProjectImportFilterSpecification how to handleProjectImports.- Specified by:
handleImportin interfaceIProjectImportFilter- Parameters:
element- AProjectImportwhich 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.
-