Class 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
    • Constructor Detail

      • NameRegExFilter

        public NameRegExFilter​(java.lang.String pattern,
                               NameRegExFilter.DataType type)
                        throws VilException
        Creates a filter.
        Parameters:
        pattern - the (valid) pattern
        type - 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 VilException
        Creates a filter.
        Parameters:
        pattern - the (valid) pattern
        type - the data type to filter on
        further - 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:
        true if string matches pattern, false else
      • include

        public boolean include​(IvmlElement element)
        Description copied from interface: IConfigurationFilter
        Returns whether a given element shall be included.
        Specified by:
        include in interface IConfigurationFilter
        Parameters:
        element - the element to be tested
        Returns:
        true if element shall be included, false else
      • checkFurther

        private boolean checkFurther​(IvmlElement element,
                                     boolean result)
        Checks whether further applies.
        Parameters:
        element - the element to be tested
        result - the result determined for including element so far
        Returns:
        true if element shall be included, false else
      • include

        private boolean include​(IvmlElement element,
                                NameRegExFilter.DataType type)
        Implements the inclusion function for a given data type.
        Parameters:
        element - the element to be tested
        type - the type of data to be considered
        Returns:
        true if element shall be included, false else