com.ihr.xbrl.dataloader

## Class Loader

- java.lang.Object
- - com.ihr.xbrl.dataloader.Loader

-     public class Loader
      extends java.lang.Object

  The Class Loader.
  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `loaderSchemaURI` The loader schema uri.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `addFilter(XBRLFacetFilter filter, java.lang.String identifier, java.lang.String driverRef)` Programatically add a new filter to this loader.
    `static Loader` | `createMasterLoader(java.lang.String transformerConfigFile, java.lang.String className, java.lang.String configFile, Mapper m)` Creates the master loader.
    `XBRLLoaderInterface` | `getDriverForKey(java.lang.String key)` Returns the target associated to this key.
    `java.lang.String` | `getDriverKeyForFilter(XBRLFacetFilter filter)` Returns the key for a specified filter.
    `java.util.Set<java.lang.String>` | `getDriverKeys()` Return the set of keys for event targets on this loader.
    `XBRLFacetFilter` | `getEventForKey(java.lang.String key)` Returns the filter associated to this key.
    `java.util.Set<java.lang.String>` | `getEventKeys()` Return the set of keys for event generators for this loader.
    `java.util.Collection<XBRLFacetFilter>` | `getEventsForConcept(javax.xml.namespace.QName conceptQName)` Return a Collection of XBRLFacetFilter in which this concept's QName is involved or null if there is none .
    `java.lang.String` | `getNewIdentifierKey()` Creates a new identifier that can be used to identify an event.
    `java.lang.Object[]` | `load(XBRLInstance instance)` Process the content of an instance document.
    `void` | `migrateConfigFile(XBRLInstance versioningReport, java.net.URI outputReportUri, java.net.URI newConfigFileUri)` Migrate config file.
    `void` | `removeFilter(java.lang.String identifier)` Remove a filter from the loader.
    `void` | `setDriverForKey(java.lang.String key, XBRLLoaderInterface driver)` Sets the driver for key.
    `void` | `setURI(java.net.URI newURI)` Changes or sets the URI of the configuration file.
    `void` | `writeConfigFile()` Write config file.

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

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

- - ### Field Detail

    - #### loaderSchemaURI

          public static java.lang.String loaderSchemaURI

      The loader schema uri.

  - ### Method Detail

    - #### getNewIdentifierKey

          public java.lang.String getNewIdentifierKey()

      Creates a new identifier that can be used to identify an event.
      Returns:
        String

    - #### setURI

          public void setURI(java.net.URI newURI)

      Changes or sets the URI of the configuration file.
      Parameters:
        `newURI` - URI

    - #### writeConfigFile

          public void writeConfigFile()
                               throws LoaderException

      Write config file.
      Throws:
        `LoaderException` - the loader exception

    - #### load

          public java.lang.Object[] load(XBRLInstance instance)
                                  throws LoaderException

      Process the content of an instance document. That is, this method goes throw all items in the instance and for each one of them it tries to execute all the filters. For those facts where the filter is satisfied a new event is produced and send to the drivers to be consumed
      Parameters:
        `instance` - the instance
      Returns:
        Object[]
      Throws:
        `LoaderException` - the loader exception

    - #### getEventKeys

          public java.util.Set<java.lang.String> getEventKeys()

      Return the set of keys for event generators for this loader.
      Returns:
        Set<String> with all event generator keys

    - #### getDriverKeys

          public java.util.Set<java.lang.String> getDriverKeys()

      Return the set of keys for event targets on this loader.
      Returns:
        Set<String> with all target keys

    - #### getEventForKey

          public XBRLFacetFilter getEventForKey(java.lang.String key)

      Returns the filter associated to this key.
      Parameters:
        `key` - String
      Returns:
        XBRLFacetFilter

    - #### getDriverForKey

          public XBRLLoaderInterface getDriverForKey(java.lang.String key)

      Returns the target associated to this key.
      Parameters:
        `key` - String
      Returns:
        XBRLReportHandlerInterface

    - #### setDriverForKey

          public void setDriverForKey(java.lang.String key,
                             XBRLLoaderInterface driver)

      Sets the driver for key.
      Parameters:
        `key` - the key
        `driver` - the driver

    - #### migrateConfigFile

          public void migrateConfigFile(XBRLInstance versioningReport,
                               java.net.URI outputReportUri,
                               java.net.URI newConfigFileUri)

      Migrate config file.
      Parameters:
        `versioningReport` - the versioning report
        `outputReportUri` - the output report uri
        `newConfigFileUri` - the new config file uri

    - #### getEventsForConcept

          public java.util.Collection<XBRLFacetFilter> getEventsForConcept(javax.xml.namespace.QName conceptQName)

      Return a Collection of XBRLFacetFilter in which this concept's QName is involved or null if there is none .
      Parameters:
        `conceptQName` - as a QName
      Returns:
        the events for concept

    - #### addFilter

          public java.lang.String addFilter(XBRLFacetFilter filter,
                                   java.lang.String identifier,
                                   java.lang.String driverRef)

      Programatically add a new filter to this loader.
      Parameters:
        `filter` - the filter
        `identifier` - String if null a new identifier is created if not null it MUST not exist.
        `driverRef` - the driver ref
      Returns:
        String the new key associated to the filter

    - #### removeFilter

          public void removeFilter(java.lang.String identifier)

      Remove a filter from the loader.
      Parameters:
        `identifier` - the identifier

    - #### getDriverKeyForFilter

          public java.lang.String getDriverKeyForFilter(XBRLFacetFilter filter)

      Returns the key for a specified filter.
      Parameters:
        `filter` - the XBRLFacetFilter
      Returns:
        a String with the key

    - #### createMasterLoader

          public static Loader createMasterLoader(java.lang.String transformerConfigFile,
                                  java.lang.String className,
                                  java.lang.String configFile,
                                  Mapper m)
                                           throws MapConfigurationFileException

      Creates the master loader.
      Parameters:
        `transformerConfigFile` - the transformer config file
        `className` - the class name
        `configFile` - the config file
        `m` - the m
      Returns:
        the loader
      Throws:
        `MapConfigurationFileException` - the map configuration file exception