com.ihr.xbrl.util

## Class LoadDTSInThread

- java.lang.Object
- - com.ihr.xbrl.util.LoadDTSInThread

- All Implemented Interfaces:
    java.lang.Runnable

      public class LoadDTSInThread
      extends java.lang.Object
      implements java.lang.Runnable

  Load a DTS in a separate thread. This class is responsible of loading and validating a DTS against the XBRL 2.1 specification and the XDT specification. Other validation processors can use the DTS returned by this object for further validation process. Separate licenses are required for XBRL 2.1 validation and XDT 1.0 validation. This object implements Runnable so it can be called in a new Thread. Configuration is established during object creation.
  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DTS_NAME_PROPERTY` This is a very common property used by calling applications that requires to set a name to the DTS after loading.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoadDTSInThread(javax.xml.transform.Source source, boolean bDoXBRLValidation, boolean bDoXDTValidation, boolean bErrorsAsExceptions, boolean bWarningsAsExceptions, org.apache.log4j.Appender logHandler, org.apache.log4j.Level level, DTSLoadingBarInterface bar, HasErrorsHandler errorHandler, HasReceiveXBRLLoadingEvents sendEventsTo, java.util.Properties extraProperties, DTSContainer compatibleDTS)` Creates a new object that will load a DTS and possible perform validation.
    `LoadDTSInThread(java.lang.String fileName, boolean bDoXBRLValidation, boolean bDoXDTValidation, boolean bErrorsAsExceptions, boolean bWarningsAsExceptions, org.apache.log4j.Appender logHandler, org.apache.log4j.Level level, DTSLoadingBarInterface bar, HasErrorsHandler errorHandler, HasReceiveXBRLLoadingEvents sendEventsTo, java.util.Properties extraProperties, DTSContainer compatibleDTS)` Creates a new object that will load a DTS and possible perform validation.
    `LoadDTSInThread(java.net.URI[] files, boolean bDoXBRLValidation, boolean bDoXDTValidation, boolean bErrorsAsExceptions, boolean bWarningsAsExceptions, org.apache.log4j.Appender logHandler, org.apache.log4j.Level level, DTSLoadingBarInterface bar, HasErrorsHandler errorHandler, HasReceiveXBRLLoadingEvents sendEventsTo, java.util.Properties extraProperties, DTSContainer compatibleDTS)` Creates a new object that will load a DTS and possible perform validation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `XBRLDocument` | `getDoc()` Access to the document that has been loaded in the DTS.
    `XBRLDocument` | `getDoc(int index)` Access to one of the documents loaded (if invoqued with a set of URIs).
    `int` | `getDocs()` Returns the number of documents loaded in the DTS.
    `XBRLDocument[]` | `getDocsArray()` Returns the array of documents loaded in the DTS.
    `DTSContainer` | `getDts()` Returns the DTS.
    `java.util.Properties` | `getProperties()` Access to the extra properties initiated by the calling application .
    `XBRLValidationReport` | `getValidationReport()` Access to the validation report.
    `void` | `run()`

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

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

- - ### Field Detail

    - #### DTS_NAME_PROPERTY

          public static final java.lang.String DTS_NAME_PROPERTY

      This is a very common property used by calling applications that requires to set a name to the DTS after loading.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LoadDTSInThread

          public LoadDTSInThread(java.lang.String fileName,
                         boolean bDoXBRLValidation,
                         boolean bDoXDTValidation,
                         boolean bErrorsAsExceptions,
                         boolean bWarningsAsExceptions,
                         org.apache.log4j.Appender logHandler,
                         org.apache.log4j.Level level,
                         DTSLoadingBarInterface bar,
                         HasErrorsHandler errorHandler,
                         HasReceiveXBRLLoadingEvents sendEventsTo,
                         java.util.Properties extraProperties,
                         DTSContainer compatibleDTS)
                          throws com.rs.lic.LicenseVerificationException

      Creates a new object that will load a DTS and possible perform validation. In this case only one file can be loaded in the DTS. Normally an instance document but can be also a linkbase or taxonomy schema.
      Parameters:
        `fileName` - File name to load as a string that will be the parameter to File(String).toURI()
        `bDoXBRLValidation` - true if XBRL 2.1 validation is required (license is required)
        `bDoXDTValidation` - true if XDT 1.0 validation is required (license is required)
        `bErrorsAsExceptions` - true if errors must thrown an exception rather that being stored in the XBRLValidationReport
        `bWarningsAsExceptions` - true if warnings (calculation inconsistencies) must thrown an exception rather than being stored in the XBRLValidationReport
        `logHandler` - the logHandler to report logging messages. Can be null.
        `level` - the level for the messages to be displayed.
        `bar` - the DTSLoadingBar for reporting loading and validation process. If null nothing is reported. If not null and not visible this method will make if visible at start and will dispose it at the end. If already visible this method will not dispose the bar at the end.
        `errorHandler` - is a class that implements the HasErrorsHandler interface and will be informed of errors
        `sendEventsTo` - is a class that implements the HasReceiveXBRLLoadingEvents and will be informed of the finalization of the loading process
        `extraProperties` - is a Properties object that an instance of this class can use to push information to be retrieved later by the class receiving the loading event
        `compatibleDTS` - is a DTSContainer object or null. If null, a new DTSContainer will be created and the extraProperties Properties Object will be used to set the new DTS properties. If not null, the new DTS will be compatible with this DTS (See saxon compatibility between processors) and the properties of the new DTS will be the properties of the old DTS and the extraProperties used in the parameter. The settings in the extraPropeties takes preference over the properties in the old DTS.
      Throws:
        `com.rs.lic.LicenseVerificationException` - In case the license does not allows the user to load the DTS

    - #### LoadDTSInThread

          public LoadDTSInThread(javax.xml.transform.Source source,
                         boolean bDoXBRLValidation,
                         boolean bDoXDTValidation,
                         boolean bErrorsAsExceptions,
                         boolean bWarningsAsExceptions,
                         org.apache.log4j.Appender logHandler,
                         org.apache.log4j.Level level,
                         DTSLoadingBarInterface bar,
                         HasErrorsHandler errorHandler,
                         HasReceiveXBRLLoadingEvents sendEventsTo,
                         java.util.Properties extraProperties,
                         DTSContainer compatibleDTS)
                          throws com.rs.lic.LicenseVerificationException

      Creates a new object that will load a DTS and possible perform validation. In this case only one file can be loaded in the DTS. Normally an instance document but can be also a linkbase or taxonomy schema. The document may not be serialized into a physical file but loaded in memory
      Parameters:
        `source` - XML to read
        `bDoXBRLValidation` - true if XBRL 2.1 validation is required (license is required)
        `bDoXDTValidation` - true if XDT 1.0 validation is required (license is required)
        `bErrorsAsExceptions` - true if errors must thrown an exception rather that being stored in the XBRLValidationReport
        `bWarningsAsExceptions` - true if warnings (calculation inconsistencies) must thrown an exception rather than being stored in the XBRLValidationReport
        `logHandler` - the logHandler to report logging messages. Can be null.
        `level` - the level for the messages to be displayed.
        `bar` - the DTSLoadingBar for reporting loading and validation process. If null nothing is reported. If not null and not visible this method will make if visible at start and will dispose it at the end. If already visible this method will not dispose the bar at the end.
        `errorHandler` - is a class that implements the HasErrorsHandler interface and will be informed of errors
        `sendEventsTo` - is a class that implements the HasReceiveXBRLLoadingEvents and will be informed of the finalization of the loading process
        `extraProperties` - is a Properties object that an instance of this class can use to push information to be retrieved later by the class receiving the loading event
        `compatibleDTS` - is a DTSContainer object or null. If null, a new DTSContainer will be created and the extraProperties Properties Object will be used to set the new DTS properties. If not null, the new DTS will be compatible with this DTS (See saxon compatibility between processors) and the properties of the new DTS will be the properties of the old DTS and the extraProperties used in the parameter. The settings in the extraPropeties takes preference over the properties in the old DTS.
      Throws:
        `com.rs.lic.LicenseVerificationException` - In case the license does not allows the user to load the DTS

    - #### LoadDTSInThread

          public LoadDTSInThread(java.net.URI[] files,
                         boolean bDoXBRLValidation,
                         boolean bDoXDTValidation,
                         boolean bErrorsAsExceptions,
                         boolean bWarningsAsExceptions,
                         org.apache.log4j.Appender logHandler,
                         org.apache.log4j.Level level,
                         DTSLoadingBarInterface bar,
                         HasErrorsHandler errorHandler,
                         HasReceiveXBRLLoadingEvents sendEventsTo,
                         java.util.Properties extraProperties,
                         DTSContainer compatibleDTS)
                          throws com.rs.lic.LicenseVerificationException

      Creates a new object that will load a DTS and possible perform validation. In this case only one file can be loaded in the DTS. Normally an instance document but can be also a linkbase or taxonomy schema.
      Parameters:
        `files` - [] set of URI files to load in the same DTS.
        `bDoXBRLValidation` - true if XBRL 2.1 validation is required (license is required)
        `bDoXDTValidation` - true if XDT 1.0 validation is required (license is required)
        `bErrorsAsExceptions` - true if errors must thrown an exception rather that being stored in the XBRLValidationReport
        `bWarningsAsExceptions` - true if warnings (calculation inconsistencies) must thrown an exception rather than being stored in the XBRLValidationReport
        `logHandler` - the logHandler to report logging messages. Can be null.
        `level` - the level for the messages to be displayed.
        `bar` - the DTSLoadingBar for reporting loading and validation process. If null nothing is reported. If not null and not visible this method will make if visible at start and will dispose it at the end. If already visible this method will not dispose the bar at the end.
        `errorHandler` - the error handler
        `sendEventsTo` - is a class that implements the HasReceiveXBRLLoadingEvents and will be informed of the finalization of the loading process
        `extraProperties` - is a Properties object that an instance of this class can use to push information to be retrieved later by the class receiving the loading event
        `compatibleDTS` - is a DTSContainer object or null. If null, a new DTSContainer will be created and the extraProperties Properties Object will be used to set the new DTS properties. If not null, the new DTS will be compatible with this DTS (See saxon compatibility between processors) and the properties of the new DTS will be the properties of the old DTS and the extraProperties used in the parameter. The settings in the extraPropeties takes preference over the properties in the old DTS.
      Throws:
        `com.rs.lic.LicenseVerificationException` - In case the supplied license does not allows the user to load DTSs

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`

    - #### getDoc

          public XBRLDocument getDoc()

      Access to the document that has been loaded in the DTS.
      Returns:
        XBRLDocument (linkbase, taxonomy or instance document)

    - #### getDoc

          public XBRLDocument getDoc(int index)

      Access to one of the documents loaded (if invoqued with a set of URIs).
      Parameters:
        `index` - document index
      Returns:
        XBRLDocument

    - #### getDocs

          public int getDocs()

      Returns the number of documents loaded in the DTS.
      Returns:
        int

    - #### getDocsArray

          public XBRLDocument[] getDocsArray()

      Returns the array of documents loaded in the DTS.
      Returns:
        XBRLDocument[]

    - #### getDts

          public DTSContainer getDts()

      Returns the DTS.
      Returns:
        DTSContainer object

    - #### getValidationReport

          public XBRLValidationReport getValidationReport()

      Access to the validation report.
      Returns:
        XBRLValidationReport

    - #### getProperties

          public java.util.Properties getProperties()

      Access to the extra properties initiated by the calling application .
      Returns:
        the extraProperties