Class StandardJarScanFilter

  • All Implemented Interfaces:
    JarScanFilter

    public class StandardJarScanFilter
    extends java.lang.Object
    implements JarScanFilter
    Standard implementation of JarScanFilter that provides configuration for JAR scanning filters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean check​(JarScanType jarScanType, java.lang.String jarName)
      Check if a JAR should be included in the scan results.
      java.lang.String getPluggabilityScan()
      Returns the pluggability scan pattern.
      java.lang.String getPluggabilitySkip()
      Returns the pluggability skip pattern.
      java.lang.String getTldScan()
      Returns the TLD scan pattern.
      java.lang.String getTldSkip()
      Returns the TLD skip pattern.
      boolean isDefaultPluggabilityScan()
      Returns whether default pluggability scanning is enabled.
      boolean isDefaultTldScan()
      Returns whether default TLD scanning is enabled.
      boolean isSkipAll()
      Determine if all JAR scans should be skipped.
      void setDefaultPluggabilityScan​(boolean defaultPluggabilityScan)
      Sets whether default pluggability scanning is enabled.
      void setDefaultTldScan​(boolean defaultTldScan)
      Sets whether default TLD scanning is enabled.
      void setPluggabilityScan​(java.lang.String pluggabilityScan)
      Sets the pluggability scan pattern.
      void setPluggabilitySkip​(java.lang.String pluggabilitySkip)
      Sets the pluggability skip pattern.
      void setTldScan​(java.lang.String tldScan)
      Sets the TLD scan pattern.
      void setTldSkip​(java.lang.String tldSkip)
      Sets the TLD skip pattern.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StandardJarScanFilter

        public StandardJarScanFilter()
        This is the standard implementation of JarScanFilter. By default, the following filtering rules are used:
        • JARs that match neither the skip nor the scan list will be included in scan results.
        • JARs that match the skip list but not the scan list will be excluded from scan results.
        • JARs that match the scan list will be included from scan results.
        The default skip list and default scan list are obtained from the system properties Constants.SKIP_JARS_PROPERTY and Constants.SCAN_JARS_PROPERTY respectively. These default values may be over-ridden for the JarScanType.TLD and JarScanType.PLUGGABILITY scans. The filtering rules may also be modified for these scan types using setDefaultTldScan(boolean) and setDefaultPluggabilityScan(boolean). If set to false, the following filtering rules are used for associated type:
        • JARs that match neither the skip nor the scan list will be excluded from scan results.
        • JARs that match the scan list but not the skip list will be included in scan results.
        • JARs that match the skip list will be excluded from scan results.
    • Method Detail

      • getTldSkip

        public java.lang.String getTldSkip()
        Returns the TLD skip pattern.
        Returns:
        the TLD skip pattern
      • setTldSkip

        public void setTldSkip​(java.lang.String tldSkip)
        Sets the TLD skip pattern.
        Parameters:
        tldSkip - the TLD skip pattern
      • getTldScan

        public java.lang.String getTldScan()
        Returns the TLD scan pattern.
        Returns:
        the TLD scan pattern
      • setTldScan

        public void setTldScan​(java.lang.String tldScan)
        Sets the TLD scan pattern.
        Parameters:
        tldScan - the TLD scan pattern
      • isSkipAll

        public boolean isSkipAll()
        Description copied from interface: JarScanFilter
        Determine if all JAR scans should be skipped.
        Specified by:
        isSkipAll in interface JarScanFilter
        Returns:
        true if all of the scans should be skipped which can improve startup performance. The default is false.
      • isDefaultTldScan

        public boolean isDefaultTldScan()
        Returns whether default TLD scanning is enabled.
        Returns:
        true if default TLD scanning is enabled
      • setDefaultTldScan

        public void setDefaultTldScan​(boolean defaultTldScan)
        Sets whether default TLD scanning is enabled.
        Parameters:
        defaultTldScan - true to enable default TLD scanning
      • getPluggabilitySkip

        public java.lang.String getPluggabilitySkip()
        Returns the pluggability skip pattern.
        Returns:
        the pluggability skip pattern
      • setPluggabilitySkip

        public void setPluggabilitySkip​(java.lang.String pluggabilitySkip)
        Sets the pluggability skip pattern.
        Parameters:
        pluggabilitySkip - the pluggability skip pattern
      • getPluggabilityScan

        public java.lang.String getPluggabilityScan()
        Returns the pluggability scan pattern.
        Returns:
        the pluggability scan pattern
      • setPluggabilityScan

        public void setPluggabilityScan​(java.lang.String pluggabilityScan)
        Sets the pluggability scan pattern.
        Parameters:
        pluggabilityScan - the pluggability scan pattern
      • isDefaultPluggabilityScan

        public boolean isDefaultPluggabilityScan()
        Returns whether default pluggability scanning is enabled.
        Returns:
        true if default pluggability scanning is enabled
      • setDefaultPluggabilityScan

        public void setDefaultPluggabilityScan​(boolean defaultPluggabilityScan)
        Sets whether default pluggability scanning is enabled.
        Parameters:
        defaultPluggabilityScan - true to enable default pluggability scanning
      • check

        public boolean check​(JarScanType jarScanType,
                             java.lang.String jarName)
        Description copied from interface: JarScanFilter
        Check if a JAR should be included in the scan results.
        Specified by:
        check in interface JarScanFilter
        Parameters:
        jarScanType - The type of JAR scan currently being performed
        jarName - The name of the JAR file (without any path information) to be checked to see if it should be included in the results or not
        Returns:
        true if the JAR should be returned in the results, false if it should be excluded