com.aventstack.extentreports.reporter

## Class ConfigurableReporter

- java.lang.Object
- - com.aventstack.extentreports.reporter.ConfigurableReporter

- All Implemented Interfaces:
    AnalysisStrategyService, ExtentReporter, TestListener
  Direct Known Subclasses:
    AbstractReporter

      public abstract class ConfigurableReporter
      extends Object
      implements ExtentReporter

  A base class to provide bootstrapping for loading custom configuration for the Reporter using XML or Properties file

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ConfigMap` | `configContext` A key-value pair holding information from default and the user-provided configuration

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigurableReporter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConfigMap` | `getConfigContext()` Returns the current configuration (default and user-defined)
    `void` | `loadConfig(InputStream stream)` Loads configuration from an `InputStream` which is a `Properties` file
    `void` | `loadConfig(Properties properties)` Loads configuration from a Properties file
    `void` | `loadConfig(String filePath)` Loads configuration from an path which is a `Properties` file
    `void` | `loadXMLConfig(File file, Boolean silent)` Loads configuration from an XML file
    `void` | `loadXMLConfig(String filePath)` Loads configuration from an XML file
    `void` | `loadXMLConfig(String filePath, Boolean silent)` Loads configuration from an XML file

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.aventstack.extentreports.ExtentReporter

      `flush, getReporterName, start, stop`

    - ### Methods inherited from interface com.aventstack.extentreports.TestListener

      `onAuthorAssigned, onCategoryAssigned, onDeviceAssigned, onLogAdded, onNodeStarted, onScreenCaptureAdded, onScreenCaptureAdded, onScreencastAdded, onTestRemoved, onTestStarted`

    - ### Methods inherited from interface com.aventstack.extentreports.AnalysisStrategyService

      `getAnalysisStrategy, setAnalysisStrategy`

- - ### Field Detail

    - #### configContext

          protected ConfigMap configContext

      A key-value pair holding information from default and the user-provided configuration

  - ### Constructor Detail

    - #### ConfigurableReporter

          public ConfigurableReporter()

  - ### Method Detail

    - #### loadXMLConfig

          public void loadXMLConfig(String filePath,
                                    Boolean silent)

      Loads configuration from an XML file
      Parameters:
        `filePath` - Configuration file path
        `silent` - Load configuration silently, no errors are thrown if the configuration file is not present

    - #### loadXMLConfig

          public void loadXMLConfig(String filePath)

      Loads configuration from an XML file
      Parameters:
        `filePath` - configuration file path

    - #### loadXMLConfig

          public void loadXMLConfig(File file,
                                    Boolean silent)

      Loads configuration from an XML file
      Parameters:
        `file` - configuration `File`
        `silent` - If silent, no errors will be thrown

    - #### loadConfig

          public void loadConfig(Properties properties)

      Loads configuration from a Properties file
      Parameters:
        `properties` - a `Properties` object

    - #### loadConfig

          public void loadConfig(InputStream stream)

      Loads configuration from an `InputStream` which is a `Properties` file
      Parameters:
        `stream` - an `InputStream`

    - #### loadConfig

          public void loadConfig(String filePath)

      Loads configuration from an path which is a `Properties` file
      Parameters:
        `filePath` - Properties file path

    - #### getConfigContext

          public ConfigMap getConfigContext()

      Returns the current configuration (default and user-defined)
      Returns:
        a `ConfigMap` containing key-value pairs of config entries

Copyright © 2018. All rights reserved.