Class Scanner

java.lang.Object
org.apache.sling.feature.scanner.Scanner

public class Scanner
extends java.lang.Object
The scanner is a service that scans items and provides descriptions for these. The following items can be scanned individually The scanner uses an internal cache for the scanned results, subsequent scan calls with the same input will be directly served from the cache. The cache is an in memory cache and its lifetime is bound to the lifetime of the used scanner instance.
  • Constructor Summary

    Constructors 
    Constructor Description
    Scanner​(org.apache.sling.feature.builder.ArtifactProvider artifactProvider)
    Create a new scanner and use the service loader to find the scanners
    Scanner​(org.apache.sling.feature.builder.ArtifactProvider artifactProvider, java.util.List<ExtensionScanner> extensionScanners, java.util.List<FrameworkScanner> frameworkScanners)
    Create a new scanner
  • Method Summary

    Modifier and Type Method Description
    BundleDescriptor scan​(org.apache.sling.feature.ArtifactId framework, java.util.Map<java.lang.String,​java.lang.String> props)
    Scan a framework
    BundleDescriptor scan​(org.apache.sling.feature.Artifact bundle, int startLevel)
    Deprecated.
    FeatureDescriptor scan​(org.apache.sling.feature.Feature feature)
    Scan a feature
    BundleDescriptor scanBundle​(org.apache.sling.feature.Artifact bundle)
    Scan a bundle

    Methods inherited from class java.lang.Object

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

    • Scanner

      public Scanner​(org.apache.sling.feature.builder.ArtifactProvider artifactProvider, java.util.List<ExtensionScanner> extensionScanners, java.util.List<FrameworkScanner> frameworkScanners) throws java.io.IOException
      Create a new scanner
      Parameters:
      artifactProvider - The artifact provider
      extensionScanners - A list of extension scanners
      frameworkScanners - A list of framework scanners
      Throws:
      java.io.IOException - If something goes wrong
    • Scanner

      public Scanner​(org.apache.sling.feature.builder.ArtifactProvider artifactProvider) throws java.io.IOException
      Create a new scanner and use the service loader to find the scanners
      Parameters:
      artifactProvider - The artifact provider
      Throws:
      java.io.IOException - If something goes wrong
  • Method Details

    • scanBundle

      public BundleDescriptor scanBundle​(org.apache.sling.feature.Artifact bundle) throws java.io.IOException
      Scan a bundle
      Parameters:
      bundle - The bundle artifact
      Returns:
      The bundle descriptor
      Throws:
      java.io.IOException - If something goes wrong or the provided artifact is not a bundle.
    • scan

      @Deprecated public BundleDescriptor scan​(org.apache.sling.feature.Artifact bundle, int startLevel) throws java.io.IOException
      Deprecated.
      Scan a bundle
      Parameters:
      bundle - The bundle artifact
      startLevel - The start level of the bundle
      Returns:
      The bundle descriptor
      Throws:
      java.io.IOException - If something goes wrong or the provided artifact is not a bundle.
    • scan

      public FeatureDescriptor scan​(org.apache.sling.feature.Feature feature) throws java.io.IOException
      Scan a feature
      Parameters:
      feature - The feature
      Returns:
      The feature descriptor
      Throws:
      java.io.IOException - If something goes wrong or a scanner is missing
    • scan

      public BundleDescriptor scan​(org.apache.sling.feature.ArtifactId framework, java.util.Map<java.lang.String,​java.lang.String> props) throws java.io.IOException
      Scan a framework
      Parameters:
      framework - The framework
      props - framework properties to launch the framework
      Returns:
      The framework descriptor
      Throws:
      java.io.IOException - If something goes wrong or a scanner is missing