Class AbstractScannerPlugin<I,D extends Descriptor>

java.lang.Object
com.buschmais.jqassistant.plugin.common.api.scanner.AbstractScannerPlugin<I,D>
All Implemented Interfaces:
ScannerPlugin<I,D>, com.buschmais.jqassistant.core.shared.lifecycle.ContextualConfigurableLifecycleAware<ScannerContext,Map<String,Object>>, com.buschmais.jqassistant.core.shared.lifecycle.LifecycleAware
Direct Known Subclasses:
AbstractResourceScannerPlugin, AbstractUriScannerPlugin, AbstractZipArchiveScannerPlugin, DirectoryResourceScannerPlugin, FileResourceScannerPlugin, GZIPFileScannerPlugin, TarFileScannerPlugin

public abstract class AbstractScannerPlugin<I,D extends Descriptor> extends Object implements ScannerPlugin<I,D>
Abstract base implementation of a ScannerPlugin.
  • Constructor Details

    • AbstractScannerPlugin

      public AbstractScannerPlugin()
  • Method Details

    • configure

      public final void configure(ScannerContext scannerContext, Map<String,Object> properties)
      Specified by:
      configure in interface com.buschmais.jqassistant.core.shared.lifecycle.ContextualConfigurableLifecycleAware<I,D extends Descriptor>
      Specified by:
      configure in interface ScannerPlugin<I,D extends Descriptor>
    • configure

      protected void configure()
      Convenience method which might be overridden by sub-classes.
    • getType

      public Class<? extends I> getType()
      Specified by:
      getType in interface ScannerPlugin<I,D extends Descriptor>
    • getDescriptorType

      public Class<D> getDescriptorType()
      Specified by:
      getDescriptorType in interface ScannerPlugin<I,D extends Descriptor>
    • getName

      public String getName()
      Specified by:
      getName in interface ScannerPlugin<I,D extends Descriptor>
    • getTypeParameter

      protected <T> Class<T> getTypeParameter(Class<?> expectedSuperClass, int genericTypeParameterIndex)
      Determines the type parameter for a generic super class.
      Parameters:
      expectedSuperClass - The generic super class.
      genericTypeParameterIndex - The index, e.g. 0 for the first.
      Returns:
      The type parameter.
    • getProperties

      protected Map<String,Object> getProperties()
      Get all properties.
      Returns:
      The properties.
    • getProperty

      protected <T> T getProperty(String name, Class<T> type)
      Get the value of a property.
      Type Parameters:
      T - The type.
      Parameters:
      name - The name of the property.
      type - The expected type.
      Returns:
      The value.
    • getStringProperty

      protected String getStringProperty(String name, String defaultValue)
      Get a property as string.
      Parameters:
      name - The name.
      defaultValue - The default value.
      Returns:
      The value.
    • getBooleanProperty

      protected Boolean getBooleanProperty(String name, Boolean defaultValue)
      Get a property as boolean.
      Parameters:
      name - The name.
      defaultValue - The default value.
      Returns:
      The value.
    • getScannerContext

      protected ScannerContext getScannerContext()
      Return the scanner context.
      Returns:
      The scanner context.
    • getDirectoryPath

      protected String getDirectoryPath(File directory, File entry)
      Return the relative path of a file within a directory.
      Parameters:
      directory - The directory.
      entry - The file.
      Returns:
      The relative path.
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object