Class NameRegExFilter
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.NameRegExFilter
-
- All Implemented Interfaces:
IConfigurationFilter
class NameRegExFilter extends java.lang.Object implements IConfigurationFilter
A name filter based on regular expressions (Perl-Style).- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNameRegExFilter.DataTypeDefines the data type to filter on.
-
Field Summary
Fields Modifier and Type Field Description private IConfigurationFilterfurtherprivate java.util.regex.Patternpatternprivate NameRegExFilter.DataTypetype
-
Constructor Summary
Constructors Constructor Description NameRegExFilter(java.lang.String pattern, NameRegExFilter.DataType type)Creates a filter.NameRegExFilter(java.lang.String pattern, NameRegExFilter.DataType type, IConfigurationFilter further)Creates a filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancheckFurther(IvmlElement element, boolean result)Checks whetherfurtherapplies.booleaninclude(IvmlElement element)Returns whether a given element shall be included.private booleaninclude(IvmlElement element, NameRegExFilter.DataType type)Implements the inclusion function for a given datatype.private booleanmatch(java.lang.String string)Determines a string match.
-
-
-
Field Detail
-
type
private NameRegExFilter.DataType type
-
further
private IConfigurationFilter further
-
pattern
private java.util.regex.Pattern pattern
-
-
Constructor Detail
-
NameRegExFilter
public NameRegExFilter(java.lang.String pattern, NameRegExFilter.DataType type) throws VilExceptionCreates a filter.- Parameters:
pattern- the (valid) patterntype- the data type to filter on- Throws:
VilException- in case that the pattern is illformed
-
NameRegExFilter
public NameRegExFilter(java.lang.String pattern, NameRegExFilter.DataType type, IConfigurationFilter further) throws VilExceptionCreates a filter.- Parameters:
pattern- the (valid) patterntype- the data type to filter onfurther- an (optional) filter to be considered (may be null)- Throws:
VilException- in case that the pattern is illformed
-
-
Method Detail
-
match
private boolean match(java.lang.String string)
Determines a string match.- Parameters:
string- the string to match- Returns:
trueifstringmatches pattern,falseelse
-
include
public boolean include(IvmlElement element)
Description copied from interface:IConfigurationFilterReturns whether a given element shall be included.- Specified by:
includein interfaceIConfigurationFilter- Parameters:
element- the element to be tested- Returns:
trueifelementshall be included,falseelse
-
checkFurther
private boolean checkFurther(IvmlElement element, boolean result)
Checks whetherfurtherapplies.- Parameters:
element- the element to be testedresult- the result determined for includingelementso far- Returns:
trueifelementshall be included,falseelse
-
include
private boolean include(IvmlElement element, NameRegExFilter.DataType type)
Implements the inclusion function for a given datatype.- Parameters:
element- the element to be testedtype- the type of data to be considered- Returns:
trueifelementshall be included,falseelse
-
-