com.ihr.xbrl.om.xdt

## Class XDTProcessor

- java.lang.Object
- - com.ihr.xbrl.om.xdt.XDTProcessor

- All Implemented Interfaces:
    XBRLPlugInProcessor

      public class XDTProcessor
      extends java.lang.Object
      implements XBRLPlugInProcessor

  This is the Dimensional processor. Implements an XBRLPlugInProcessor and provides functionality to deal with the Dimensions specification
  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `all_arcrole_URI` http://xbrl.org/int/dim/arcrole/all
    `static javax.xml.namespace.QName` | `closedQName` xbrldt:closed.
    `static javax.xml.namespace.QName` | `contextElement` xbrldt:contextElement.
    `static java.lang.String` | `dimension_default_arcrole_URI` http://xbrl.org/int/dim/arcrole/dimension-default
    `static java.lang.String` | `dimension_domain_arcrole_URI` http://xbrl.org/int/dim/arcrole/dimension-domain
    `static javax.xml.namespace.QName` | `dimensionItemQName` xbrldt:dimensionItem.
    `static javax.xml.namespace.QName` | `dimensionQName` "dimension" as a QName in the no namespace.
    `static java.lang.String` | `domain_member_arcrole_URI` http://xbrl.org/int/dim/arcrole/domain-member
    `static javax.xml.namespace.QName` | `explicitMemberContainerQName` xbrldi:explicitMember.
    `static java.lang.String` | `hypercube_dimension_arcrole_URI` http://xbrl.org/int/dim/arcrole/hypercube-dimension
    `static javax.xml.namespace.QName` | `hypercubeItemQName` xbrldt:hypercubeItem.
    `java.util.logging.Logger` | `logger` The logger.
    `static java.lang.String` | `notAll_arcrole_URI` http://xbrl.org/int/dim/arcrole/notAll
    `static java.lang.String` | `PROCESSORNAME` The Constant PROCESSORNAME.
    `static javax.xml.namespace.QName` | `targetRole` xbrldt:targetrole.
    `static javax.xml.namespace.QName` | `typedDomainRefQName` xbtldt:typedDomainRef.
    `static javax.xml.namespace.QName` | `typedMemberContainerQName` xbrldi:typedMember.
    `static javax.xml.namespace.QName` | `usableQName` "usable" as a QName in the no namespace.
    `static int` | `XDT_07_09_2009` Constant indicating that the processor is running under rules written in the specification written as of September 7th 2009.
    `static int` | `XDT_18_09_2006` Constant indicating that the processor is running under rules written in the specification written as of September 18th 2006.
    `static int` | `XDT_25_01_2012` Constant indicating that the processor is running under rules written in the specification written as of January 1st 2012.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Called when the DTSContainer's clear method is called.
    `void` | `configure(java.util.Properties properties)` Configures the processor according with the properties passed in in the properties parameter.
    `static XDTProcessor` | `create(DTSContainer dts)` Creates the XDTProcessor instance and stores the instance in the DTSContaniner If an XDTProcessor is already registered for this DTSContainer the already created instance is returned.
    `XBRLArcroleType` | `getArcroleTypeAll()` Gets the arcrole type all.
    `XBRLArcroleType` | `getArcroleTypeDimensionDefault()` Gets the arcrole type dimension default.
    `XBRLArcroleType` | `getArcroleTypeDimensionDomain()` Gets the arcrole type dimension domain.
    `XBRLArcroleType` | `getArcroleTypeDomainMember()` Gets the arcrole type domain member.
    `XBRLArcroleType` | `getArcroleTypeHypercubeDimension()` Gets the arcrole type hypercube dimension.
    `XBRLArcroleType` | `getArcroleTypeNotAll()` Gets the arcrole type not all.
    `DTSContainer` | `getContainer()` Gets the container.
    `int` | `getContainerForPrimaryItemAndDimension(javax.xml.namespace.QName dimension, javax.xml.namespace.QName primaryItem)` Helper function to find the context container associated to a dimension under the light of a primary item.
    `java.lang.String` | `getDescription()` Returns the processor description so it can be written in validation reports.
    `static java.lang.String` | `getDescriptionStatic()` Gets the description static.
    `java.util.Hashtable<javax.xml.namespace.QName,XMLFragment>` | `getDimData(XBRLDimensionsContainer dimData, boolean throwValidationExceptions)` Process a fact item and one of the dimensions container (segment or scenario) and collects all dimensional information in there.
    `java.util.Hashtable<javax.xml.namespace.QName,XMLFragment>` | `getDimData(XBRLFactItem fact, int contextElement, boolean bThrowValidationExceptions)` Process a fact item in an XBRL report and collects data from the context according to dimensions defined in the hypercubes.
    `XDTDimension` | `getDimension(javax.xml.namespace.QName dimension)` Access to an XDTDimension from its dimension name or null if the QName does not refer to a dimension in the loaded DTS.
    `java.util.Iterator<XDTDimension>` | `getDimensions()` Access to the list of all dimensions defined in the DTS.
    `static XMLFragment` | `getExplicitDimFragment(DTSContainer dts, javax.xml.namespace.QName dimension, javax.xml.namespace.QName member)` Helper method to create the XMLFragment container for an explicit dimension.
    `java.lang.String` | `getName()` Returns the processor name so it can be written in validation reports.
    `java.lang.Integer` | `getPreferredContainer(javax.xml.namespace.QName elementQName, javax.xml.namespace.QName qDim, int container)` Gets the preferred container.
    `XDTPrimaryItem` | `getPrimaryItem(javax.xml.namespace.QName q)` Returns the XDTPrimatyItem object for the given QName or null if the item does not have dimensions (associated hypercubes or dimensional information).
    `java.util.Iterator<javax.xml.namespace.QName>` | `getPrimaryItems()` Returns an iterator over QNames that are primary items in this dimensional DTS.
    `static XBRLRoleType` | `getTargetRole(XBRLRelationship rel)` Returns the XBRLRoleType pointed to by the xbrldt:targetRole attribute on the relationship rel.
    `static XMLFragment` | `getTypedDimFragment(DTSContainer dts, javax.xml.namespace.QName dimension, net.sf.saxon.s9api.XdmValue value)` Helper method to create the XMLFragment container for a typed dimension.
    `static XMLFragment` | `getTypedDimFragment(DTSContainer dts, javax.xml.namespace.QName dimension, XMLFragment value)` Helper method to create the XMLFragment container for a typed dimension.
    `static java.lang.Boolean` | `getUsable(XBRLRelationship rel)` Gets the usable.
    `int` | `getXDTVersion()` This functions returns an integer constant that is cached in the XDTProcessor and indicates the version of the XDTSpecification to be used.
    `static boolean` | `isClosed(XBRLRelationship rel)` Returns the value or default value of the xbrldt:closed attribute on the relationship indicated in the rel parameter.
    `boolean` | `isHidden()` A hidden processor will not pop-up in the GUI tabs.
    `void` | `removeDomainMember(XMLFragment fragment)` Removes the domain member.
    `XBRLValidationReport` | `validate()` Validates the content of the DTS according to the rules indicated in this plug-in processor.
    `XBRLValidationReport` | `validate(XBRLDocument doc)` Validates all facts in the instance document.

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

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

- - ### Field Detail

    - #### PROCESSORNAME

          public static final java.lang.String PROCESSORNAME

      The Constant PROCESSORNAME.
      See Also:
        Constant Field Values

    - #### hypercubeItemQName

          public static final javax.xml.namespace.QName hypercubeItemQName

      xbrldt:hypercubeItem.

    - #### dimensionItemQName

          public static final javax.xml.namespace.QName dimensionItemQName

      xbrldt:dimensionItem.

    - #### explicitMemberContainerQName

          public static final javax.xml.namespace.QName explicitMemberContainerQName

      xbrldi:explicitMember.

    - #### typedMemberContainerQName

          public static final javax.xml.namespace.QName typedMemberContainerQName

      xbrldi:typedMember.

    - #### typedDomainRefQName

          public static final javax.xml.namespace.QName typedDomainRefQName

      xbtldt:typedDomainRef.

    - #### dimensionQName

          public static final javax.xml.namespace.QName dimensionQName

      "dimension" as a QName in the no namespace.

    - #### usableQName

          public static final javax.xml.namespace.QName usableQName

      "usable" as a QName in the no namespace.

    - #### targetRole

          public static final javax.xml.namespace.QName targetRole

      xbrldt:targetrole.

    - #### closedQName

          public static final javax.xml.namespace.QName closedQName

      xbrldt:closed.

    - #### contextElement

          public static final javax.xml.namespace.QName contextElement

      xbrldt:contextElement.

    - #### all_arcrole_URI

          public static final java.lang.String all_arcrole_URI

      http://xbrl.org/int/dim/arcrole/all

    - #### notAll_arcrole_URI

          public static final java.lang.String notAll_arcrole_URI

      http://xbrl.org/int/dim/arcrole/notAll

    - #### hypercube_dimension_arcrole_URI

          public static final java.lang.String hypercube_dimension_arcrole_URI

      http://xbrl.org/int/dim/arcrole/hypercube-dimension

    - #### domain_member_arcrole_URI

          public static final java.lang.String domain_member_arcrole_URI

      http://xbrl.org/int/dim/arcrole/domain-member

    - #### dimension_domain_arcrole_URI

          public static final java.lang.String dimension_domain_arcrole_URI

      http://xbrl.org/int/dim/arcrole/dimension-domain

    - #### dimension_default_arcrole_URI

          public static final java.lang.String dimension_default_arcrole_URI

      http://xbrl.org/int/dim/arcrole/dimension-default

    - #### logger

          public java.util.logging.Logger logger

      The logger.

    - #### XDT_07_09_2009

          public static final int XDT_07_09_2009

      Constant indicating that the processor is running under rules written in the specification written as of September 7th 2009.
      See Also:
        Constant Field Values

    - #### XDT_18_09_2006

          public static final int XDT_18_09_2006

      Constant indicating that the processor is running under rules written in the specification written as of September 18th 2006.
      See Also:
        Constant Field Values

    - #### XDT_25_01_2012

          public static final int XDT_25_01_2012

      Constant indicating that the processor is running under rules written in the specification written as of January 1st 2012. Note this is exactly the same specification as the one released on September 7th 2009
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### create

          public static XDTProcessor create(DTSContainer dts)
                                     throws com.rs.lic.LicenseVerificationException,
                                            XBRLValidationException

      Creates the XDTProcessor instance and stores the instance in the DTSContaniner If an XDTProcessor is already registered for this DTSContainer the already created instance is returned.
      Parameters:
        `dts` - the dts
      Returns:
        the XDT processor
      Throws:
        `com.rs.lic.LicenseVerificationException` - the license verification exception
        `XBRLValidationException` - the XBRL validation exception

    - #### configure

          public void configure(java.util.Properties properties)

      Description copied from interface: `XBRLPlugInProcessor`
      Configures the processor according with the properties passed in in the properties parameter.
      Specified by:
        `configure` in interface `XBRLPlugInProcessor`
      Parameters:
        `properties` - the properties

    - #### getPrimaryItem

          public XDTPrimaryItem getPrimaryItem(javax.xml.namespace.QName q)

      Returns the XDTPrimatyItem object for the given QName or null if the item does not have dimensions (associated hypercubes or dimensional information).
      Parameters:
        `q` - QName the concept QName
      Returns:
        XDTPrimaryItem

    - #### getPrimaryItems

          public java.util.Iterator<javax.xml.namespace.QName> getPrimaryItems()

      Returns an iterator over QNames that are primary items in this dimensional DTS. Never returns null. If the DTS does not has primary items, the returned iterator has no elements
      Returns:
        Iterator may be an empty iterator if this is not a dimensional DTS

    - #### getDimensions

          public java.util.Iterator<XDTDimension> getDimensions()

      Access to the list of all dimensions defined in the DTS.
      Returns:
        Iterator<XDTDimension>

    - #### removeDomainMember

          public void removeDomainMember(XMLFragment fragment)

      Removes the domain member.
      Parameters:
        `fragment` - the fragment

    - #### getTargetRole

          public static XBRLRoleType getTargetRole(XBRLRelationship rel)

      Returns the XBRLRoleType pointed to by the xbrldt:targetRole attribute on the relationship rel.

      If the relationship does not contains a xbrldt:targetRole attribute, the returned value is null.

      Parameters:
        `rel` - XBRLRelationship
      Returns:
        XBRLRoleType or null if not set
      Since:
        2.6.10

    - #### getContainer

          public DTSContainer getContainer()

      Gets the container.
      Returns:
        the container

    - #### getArcroleTypeAll

          public XBRLArcroleType getArcroleTypeAll()

      Gets the arcrole type all.
      Returns:
        the arcrole type all

    - #### getArcroleTypeDomainMember

          public XBRLArcroleType getArcroleTypeDomainMember()

      Gets the arcrole type domain member.
      Returns:
        the arcrole type domain member

    - #### getArcroleTypeHypercubeDimension

          public XBRLArcroleType getArcroleTypeHypercubeDimension()

      Gets the arcrole type hypercube dimension.
      Returns:
        the arcrole type hypercube dimension

    - #### getArcroleTypeNotAll

          public XBRLArcroleType getArcroleTypeNotAll()

      Gets the arcrole type not all.
      Returns:
        the arcrole type not all

    - #### getArcroleTypeDimensionDomain

          public XBRLArcroleType getArcroleTypeDimensionDomain()

      Gets the arcrole type dimension domain.
      Returns:
        the arcrole type dimension domain

    - #### getArcroleTypeDimensionDefault

          public XBRLArcroleType getArcroleTypeDimensionDefault()

      Gets the arcrole type dimension default.
      Returns:
        the arcrole type dimension default

    - #### getXDTVersion

          public int getXDTVersion()

      This functions returns an integer constant that is cached in the XDTProcessor and indicates the version of the XDTSpecification to be used.
      Possible values are `DTSContainer.USE_XDT_1_0_AS_OF_7_SEP_2009` and `DTSContainer.USE_XDT_1_0_AS_OF_18_SEP_2006` and `DTSContainer.USE_XDT_1_0_AS_OF_25_JAN_2012`

      The value -1 is returned in case the property XDT_VERSION is defined for the DTSContainer but the property value is not any of the registered property values

      Returns:
        integer constant

    - #### getDimData

          public java.util.Hashtable<javax.xml.namespace.QName,XMLFragment> getDimData(XBRLFactItem fact,
                                                                              int contextElement,
                                                                              boolean bThrowValidationExceptions)

      Process a fact item in an XBRL report and collects data from the context according to dimensions defined in the hypercubes.
      Parameters:
        `fact` - the fact
        `contextElement` - the context element, either XDTHypercubeUse.SCENARIO or XDTHypercubeUse.SEGMENT
        `bThrowValidationExceptions` - the b throw validation exceptions
      Returns:
        Hashtable<QName,XMLFragment>

    - #### getDimData

          public java.util.Hashtable<javax.xml.namespace.QName,XMLFragment> getDimData(XBRLDimensionsContainer dimData,
                                                                              boolean throwValidationExceptions)

      Process a fact item and one of the dimensions container (segment or scenario) and collects all dimensional information in there.
      Parameters:
        `dimData` - the XBRLDimensionsContainer
        `throwValidationExceptions` - the throw validation exceptions
      Returns:
        Hashtable<QName,XMLFragment>

    - #### validate

          public XBRLValidationReport validate(XBRLDocument doc)

      Validates all facts in the instance document. This call does not validate the taxonomy.
      Specified by:
        `validate` in interface `XBRLPlugInProcessor`
      Parameters:
        `doc` - the doc
      Returns:
        the XBRL validation report

    - #### validate

          public XBRLValidationReport validate()

      Description copied from interface: `XBRLPlugInProcessor`
      Validates the content of the DTS according to the rules indicated in this plug-in processor.

      This is the method that is called by the DTSContainer on each XBRLPlugInProcessor when the validation() method is called on the DTSContainer instance.

      Specified by:
        `validate` in interface `XBRLPlugInProcessor`
      Returns:
        an XBRLValidationReport object `XBRLValidationReport`

    - #### getDimension

          public XDTDimension getDimension(javax.xml.namespace.QName dimension)

      Access to an XDTDimension from its dimension name or null if the QName does not refer to a dimension in the loaded DTS.
      Parameters:
        `dimension` - the dimension
      Returns:
        the dimension

    - #### getUsable

          public static java.lang.Boolean getUsable(XBRLRelationship rel)

      Gets the usable.
      Parameters:
        `rel` - the rel
      Returns:
        the usable

    - #### isClosed

          public static boolean isClosed(XBRLRelationship rel)

      Returns the value or default value of the xbrldt:closed attribute on the relationship indicated in the rel parameter. Note, if the relationship is not an all or notAll is not checked by this method.
      Parameters:
        `rel` - relationship
      Returns:
        true if closed="true", false otherwise, false is the default value.

    - #### getDescription

          public java.lang.String getDescription()

      Description copied from interface: `XBRLPlugInProcessor`
      Returns the processor description so it can be written in validation reports.
      Specified by:
        `getDescription` in interface `XBRLPlugInProcessor`
      Returns:
        the description

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `XBRLPlugInProcessor`
      Returns the processor name so it can be written in validation reports.
      Specified by:
        `getName` in interface `XBRLPlugInProcessor`
      Returns:
        the name

    - #### getDescriptionStatic

          public static java.lang.String getDescriptionStatic()

      Gets the description static.
      Returns:
        the description static

    - #### getExplicitDimFragment

          public static XMLFragment getExplicitDimFragment(DTSContainer dts,
                                           javax.xml.namespace.QName dimension,
                                           javax.xml.namespace.QName member)

      Helper method to create the XMLFragment container for an explicit dimension.
      Parameters:
        `dts` - The DTSContainer the new fragment will belong to
        `dimension` - the QName of the dimension container. Note it is not validated the dimension exist on the DTS
        `member` - the QName value for the dimension. Note it is not validated the qname is a dimension member.
      Returns:
        a new XMLFragment that can be added to the segment or scenario containers that represents the explicit dimension container and dimension value
      Since:
        2.7.0

    - #### getTypedDimFragment

          public static XMLFragment getTypedDimFragment(DTSContainer dts,
                                        javax.xml.namespace.QName dimension,
                                        XMLFragment value)

      Helper method to create the XMLFragment container for a typed dimension.
      Parameters:
        `dts` - The DTSContainer the new fragment will belong to
        `dimension` - the QName of the dimension container. Note it is not validated the dimension exist on the DTS
        `value` - the typed dimension child element
      Returns:
        a new XMLFragment that can be added to the segment or scenario containers that represents the typed dimension container and dimension value
      Since:
        2.7.0

    - #### getTypedDimFragment

          public static XMLFragment getTypedDimFragment(DTSContainer dts,
                                        javax.xml.namespace.QName dimension,
                                        net.sf.saxon.s9api.XdmValue value)

      Helper method to create the XMLFragment container for a typed dimension.
      Parameters:
        `dts` - The DTSContainer the new fragment will belong to
        `dimension` - the QName of the dimension container. Note it is not validated the dimension exist on the DTS
        `value` - the typed dimension child element
      Returns:
        a new XMLFragment that can be added to the segment or scenario containers that represents the typed dimension container and dimension value
      Since:
        2.7.0

    - #### getContainerForPrimaryItemAndDimension

          public int getContainerForPrimaryItemAndDimension(javax.xml.namespace.QName dimension,
                                                   javax.xml.namespace.QName primaryItem)

      Helper function to find the context container associated to a dimension under the light of a primary item.
      Parameters:
        `dimension` - the dimension
        `primaryItem` - the primary item
      Returns:
        integer constant that can be either `XDTHypercubeUse.SCENARIO`, `XDTHypercubeUse.SEGMENT` or `XDTHypercubeUse.UNDEFINED` in case the primary item is open and does not contain a explicit container for the dimension or any other reason

    - #### getPreferredContainer

          public java.lang.Integer getPreferredContainer(javax.xml.namespace.QName elementQName,
                                                javax.xml.namespace.QName qDim,
                                                int container)

      Gets the preferred container.
      Parameters:
        `elementQName` - the element q name
        `qDim` - the q dim
        `container` - the container
      Returns:
        the preferred container

    - #### isHidden

          public boolean isHidden()

      Description copied from interface: `XBRLPlugInProcessor`
      A hidden processor will not pop-up in the GUI tabs.
      Specified by:
        `isHidden` in interface `XBRLPlugInProcessor`
      Returns:
        true if processor is hidden. False if the processor has a GUI

    - #### clear

          public void clear()

      Description copied from interface: `XBRLPlugInProcessor`
      Called when the DTSContainer's clear method is called. Shall clean up resources and empty tables.
      Specified by:
        `clear` in interface `XBRLPlugInProcessor`