com.ihr.xbrl.adins.efm

## Class EFMProcessor

- java.lang.Object
- - com.ihr.xbrl.adins.efm.EFMProcessor

- All Implemented Interfaces:
    XBRLPlugInProcessor

      public class EFMProcessor
      extends java.lang.Object
      implements XBRLPlugInProcessor

  The Class EFMProcessor.
  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEI_2008_NS` Namespace for the dei taxonomy. this is commonly used so it is declared here.
    `static java.lang.String` | `DEI_2009_NS` Namespace for the dei taxonomy. this is commonly used so it is declared here.
    `static java.lang.String` | `DEI_2011_NS` Namespace for the dei taxonomy. this is commonly used so it is declared here.
    `static java.lang.String` | `DEI_2012_NS` Namespace for the dei taxonomy. this is commonly used so it is declared here.
    `static java.lang.String` | `EdgarTaxonomiesFile` XML file that contains a description of all files that can be used for SEC filing.
    `static java.lang.String` | `EFM_PARAMETER_RESOLVER` The EFM_PARAMETER_RESOLVER property contains an instance of a class that implements the EFMParameterResolver interface.
    `static java.lang.String` | `EFM_VERSION` The EFM_VERSION property indicates the version of the Edgar Filer Manual document to be used.
    `static java.lang.String` | `EFM_VERSION_18_111122` The EFM_VERSION_18_111122 property indicates the processor will use EFM rules in the version 18_111122 of the EFM document.
    `static java.lang.String` | `EFM_VERSION_18_120228` The EFM_VERSION_18_120228 property indicates the processor will use EFM rules in the version 18_120228 of the EFM document.
    `static java.lang.String` | `NONNUM_NS` Namespace for non-numeric. created by XBRL International in the light of harmonizing the content of the US-GAAP taxonomy and the IFRS taxonomy.
    `static java.lang.String` | `PROCESSORNAME` The Constant PROCESSORNAME.
    `static java.lang.String` | `US_GAAP` Namespace for US_GAAP.
    `static java.lang.String` | `US_TYPES_2008_NS` Namespace for us-types.
    `static java.lang.String` | `US_TYPES_2009_NS` Namespace for us-types.
    `static java.lang.String` | `US_TYPES_2011_NS` Namespace for us-types.
    `static java.lang.String` | `US_TYPES_2012_NS` Namespace for us-types.

  - ### 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 EFMProcessor` | `create(DTSContainer dts)` Obtains the instance of the EFMProcessor that has been registered for this DTS.
    `DTSContainer` | `getContainer()` Gets the container.
    `java.lang.String[]` | `getDEIVersions()` Depending on the value of the EFM_VERSION, this method returns different sets of namespaces to searc for.
    `java.lang.String` | `getDescription()` Returns the processor description so it can be written in validation reports.
    `static java.lang.String` | `getDescriptionStatic()` Obtains the description of this processor regardless of the instance.
    `java.lang.String` | `getEFMLang(XMLFragment f)` Returns the value or default value of the xml:lang attribute on the XMLFragment passed in as a parameter.
    `java.lang.String` | `getEnglishStandardLanguage(XMLFragment f)` Access to the "English Standard Language" label as defined in the EFM.
    `java.lang.String` | `getName()` Returns the processor name so it can be written in validation reports.
    `java.lang.Object` | `getParameterValue(java.lang.String parameterName)` Returns the value assigned to the parameter indicated in the name. or null if no value has been assigned or if there is no a parameter resolver assigned to this processor.
    `java.lang.String` | `getRegistrantName(java.lang.String identifier)` The parameter is a CIK identifier.
    `boolean` | `isDefaultParameterValue(java.lang.String parameterName, java.lang.Object parameterValue)` returns true if the value inParameterObj is the default value for the parameter indicated in param.
    `boolean` | `isDerivedFromDomainItemType(XBRLItem item, boolean inStandardTaxonomy)` Checks if is derived from domain item type.
    `boolean` | `isHidden()` A hidden processor will not pop-up in the GUI tabs.
    `boolean` | `isInternalAndShallNotBeUsed(java.net.URI hRef)` Returns true if the document indicated in the URI shall not be directly referenced by company files .
    `boolean` | `isStandard(java.net.URI hRef)` Validates the URI passed in as parameter is one of the standard taxonomy schemas.
    `boolean` | `isStandardNamespaceURI(java.lang.String uriRef)` Validates the URI passed in as parameter is one of the standard taxonomy schemas.
    `static boolean` | `isXMLWhiteSpace(char ch)` Checks if is XML white space.
    `XBRLValidationReport` | `validate()` Validates the content of the DTS according to the rules indicated in this plug-in processor.
    `XBRLValidationReport` | `validate(XBRLDocument xDocument)` Validates the document according to the rules indicated in this plug-in processor.
    `XBRLValidationReport` | `validateAtMostOneAll(XMLElementDefinition elDef)` Validate at most one all.
    `XBRLValidationReport` | `validateCalculationAndPresentation(XBRLItem fromItem, XBRLItem toItem)` 6.14.5 If an instance contains non-empty facts for the source and target of an effective calculation relationship, then at least one effective presentation relationship that the source and target appear in (because of 6.12.3) must be either (a) a relationship with each other or (b) two relationships with any other elements that share a single extended link role.
    `void` | `validateEFMURI(java.net.URI hRef)` Validates the URI from an xlink:href attribute.
    `XBRLValidationReport` | `validateOneLabelPerRoleAndLang(XMLFragment f)` Validate one label per role and lang.
    `XBRLValidationReport` | `validatePresentationNetworks(XMLFragment elDef)` Validates EFM rule 6.12.3 An element used in an instance must participate in at least one effective presentation relationship in the DTS of that instance.
    `XBRLValidationReport` | `validatePresentationPreferredLabels(XMLFragment elDef, java.util.HashSet<XMLFragment> processed)` Validates EFM rule 6.12.3 An element used in an instance must participate in at least one effective presentation relationship in the DTS of that instance.
    `XBRLValidationReport` | `validateTextIsProperHTML(java.lang.String stringValue, XBRLFact fact, XBRLResource res)` Validate text is proper html.
    `XBRLValidationReport` | `validateTextIsProperHTML(XBRLFact fact)` Validate text is proper html.
    `XBRLValidationReport` | `validateTextIsProperHTML(XBRLResource res)` Validate text is proper html.

    - ### 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

    - #### DEI_2012_NS

          public static final java.lang.String DEI_2012_NS

      Namespace for the dei taxonomy. this is commonly used so it is declared here. The value is http://xbrl.sec.gov/dei/2012-01-31
      See Also:
        Constant Field Values

    - #### DEI_2011_NS

          public static final java.lang.String DEI_2011_NS

      Namespace for the dei taxonomy. this is commonly used so it is declared here. The value is http://xbrl.sec.gov/dei/2011-01-31
      See Also:
        Constant Field Values

    - #### DEI_2009_NS

          public static final java.lang.String DEI_2009_NS

      Namespace for the dei taxonomy. this is commonly used so it is declared here. The value is http://xbrl.us/dei/2009-01-31
      See Also:
        Constant Field Values

    - #### DEI_2008_NS

          public static final java.lang.String DEI_2008_NS

      Namespace for the dei taxonomy. this is commonly used so it is declared here. The value is http://xbrl.us/dei/2008-03-31
      See Also:
        Constant Field Values

    - #### NONNUM_NS

          public static final java.lang.String NONNUM_NS

      Namespace for non-numeric. created by XBRL International in the light of harmonizing the content of the US-GAAP taxonomy and the IFRS taxonomy.
      See Also:
        Constant Field Values

    - #### US_TYPES_2012_NS

          public static final java.lang.String US_TYPES_2012_NS

      Namespace for us-types. Created by the XBRL-US jurisdiction in 2011.
      See Also:
        Constant Field Values

    - #### US_TYPES_2011_NS

          public static final java.lang.String US_TYPES_2011_NS

      Namespace for us-types. Created by the XBRL-US jurisdiction in 2011.
      See Also:
        Constant Field Values

    - #### US_TYPES_2009_NS

          public static final java.lang.String US_TYPES_2009_NS

      Namespace for us-types. Created by the XBRL-US jurisdiction in 2009.
      See Also:
        Constant Field Values

    - #### US_TYPES_2008_NS

          public static final java.lang.String US_TYPES_2008_NS

      Namespace for us-types. Created by the XBRL-US jurisdiction in 2008.
      See Also:
        Constant Field Values

    - #### US_GAAP

          public static final java.lang.String US_GAAP

      Namespace for US_GAAP. Created by the FASB.
      See Also:
        Constant Field Values

    - #### EdgarTaxonomiesFile

          public static final java.lang.String EdgarTaxonomiesFile

      XML file that contains a description of all files that can be used for SEC filing.
      See Also:
        Constant Field Values

    - #### EFM_VERSION

          public static final java.lang.String EFM_VERSION

      The EFM_VERSION property indicates the version of the Edgar Filer Manual document to be used. The possible value is EFM_VERSION_18. More values will be added in the future.

      The value of the EFM_VERSION constant is "http://www.reportingstandard.com/properties/efm-version".

      The default value for the property it refers to is EFM_VERSION_18 which is the lastest release.

      See Also:
        Constant Field Values

    - #### EFM_PARAMETER_RESOLVER

          public static final java.lang.String EFM_PARAMETER_RESOLVER

      The EFM_PARAMETER_RESOLVER property contains an instance of a class that implements the EFMParameterResolver interface. That interface shall be able to obtain parameters, parameter values and the parameter type as they are documented in the EFM conformance suite.
      See Also:
        Constant Field Values

    - #### EFM_VERSION_18_111122

          public static final java.lang.String EFM_VERSION_18_111122

      The EFM_VERSION_18_111122 property indicates the processor will use EFM rules in the version 18_111122 of the EFM document.
      See Also:
        Constant Field Values

    - #### EFM_VERSION_18_120228

          public static final java.lang.String EFM_VERSION_18_120228

      The EFM_VERSION_18_120228 property indicates the processor will use EFM rules in the version 18_120228 of the EFM document.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getDEIVersions

          public java.lang.String[] getDEIVersions()

      Depending on the value of the EFM_VERSION, this method returns different sets of namespaces to searc for.
      Returns:
        array of namespaces as Strings

    - #### create

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

      Obtains the instance of the EFMProcessor that has been registered for this DTS. If none has been registered a new one is created. The creator will register the instance within the DTS.
      Parameters:
        `dts` - the dts
      Returns:
        the EFM processor
      Throws:
        `com.rs.lic.LicenseVerificationException` - the license verification exception
        `XBRLValidationException` - the XBRL validation exception

    - #### 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`

    - #### validate

          public XBRLValidationReport validate(XBRLDocument xDocument)

      Description copied from interface: `XBRLPlugInProcessor`
      Validates the document according to the rules indicated in this plug-in processor.
      Specified by:
        `validate` in interface `XBRLPlugInProcessor`
      Parameters:
        `xDocument` - the x document
      Returns:
        an XBRLValidationReport object `XBRLValidationReport`

    - #### 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

    - #### 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

    - #### getDescriptionStatic

          public static java.lang.String getDescriptionStatic()

      Obtains the description of this processor regardless of the instance.
      Returns:
        the description static

    - #### 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

    - #### getContainer

          public DTSContainer getContainer()

      Gets the container.
      Returns:
        the container

    - #### validateEFMURI

          public void validateEFMURI(java.net.URI hRef)
                              throws EFMValidationException

      Validates the URI from an xlink:href attribute.
      Parameters:
        `hRef` - as an URI
      Throws:
        `EFMValidationException` - in case of any errors

    - #### isStandard

          public boolean isStandard(java.net.URI hRef)

      Validates the URI passed in as parameter is one of the standard taxonomy schemas.
      Parameters:
        `hRef` - the h ref
      Returns:
        boolean value

    - #### isInternalAndShallNotBeUsed

          public boolean isInternalAndShallNotBeUsed(java.net.URI hRef)

      Returns true if the document indicated in the URI shall not be directly referenced by company files .
      Parameters:
        `hRef` - the h ref
      Returns:
        boolean value

    - #### getEFMLang

          public java.lang.String getEFMLang(XMLFragment f)

      Returns the value or default value of the xml:lang attribute on the XMLFragment passed in as a parameter. The default value is "en-US" if there is no such attribute on that XMLFragment, otherwise it is the explicitly declared value.

      Note, this is not 100% XML comformant as the XML rules indicates that the value on a parent element applies. This method is not observing that rule because that behavior is not indicated in the EFM manual.

      Parameters:
        `f` - the f
      Returns:
        the EFM lang

    - #### getEnglishStandardLanguage

          public java.lang.String getEnglishStandardLanguage(XMLFragment f)

      Access to the "English Standard Language" label as defined in the EFM.

      An element “has an English standard label” in a DTS if there is an effective relationship with the defining xsd:element source, an xlink:arcrole attribute equal to “http://www.xbrl.org/2003/role/concept-label” and target link:label with an xml:lang attribute equal to “en-US” and an xlink:role attribute equal to “http://www.xbrl.org/2003/role/label”.

      This method returns null if such a label is not found.

      Parameters:
        `f` - the f
      Returns:
        String with the label text or null

    - #### validateOneLabelPerRoleAndLang

          public XBRLValidationReport validateOneLabelPerRoleAndLang(XMLFragment f)

      Validate one label per role and lang.
      Parameters:
        `f` - the f
      Returns:
        the XBRL validation report

    - #### isStandardNamespaceURI

          public boolean isStandardNamespaceURI(java.lang.String uriRef)

      Validates the URI passed in as parameter is one of the standard taxonomy schemas.
      Parameters:
        `uriRef` - the uri ref
      Returns:
        boolean value

    - #### isXMLWhiteSpace

          public static boolean isXMLWhiteSpace(char ch)

      Checks if is XML white space.
      Parameters:
        `ch` - the ch
      Returns:
        true, if is XML white space

    - #### validateTextIsProperHTML

          public XBRLValidationReport validateTextIsProperHTML(java.lang.String stringValue,
                                                      XBRLFact fact,
                                                      XBRLResource res)

      Validate text is proper html.
      Parameters:
        `stringValue` - the string value
        `fact` - the fact
        `res` - the res
      Returns:
        the XBRL validation report

    - #### validateTextIsProperHTML

          public XBRLValidationReport validateTextIsProperHTML(XBRLFact fact)

      Validate text is proper html.
      Parameters:
        `fact` - the fact
      Returns:
        the XBRL validation report

    - #### validateTextIsProperHTML

          public XBRLValidationReport validateTextIsProperHTML(XBRLResource res)

      Validate text is proper html.
      Parameters:
        `res` - the res
      Returns:
        the XBRL validation report

    - #### getParameterValue

          public java.lang.Object getParameterValue(java.lang.String parameterName)

      Returns the value assigned to the parameter indicated in the name. or null if no value has been assigned or if there is no a parameter resolver assigned to this processor.

      Note, parameter resolvers can be assigned during the instantiation of the XBRL processor.

      Parameters:
        `parameterName` - must be a string
      Returns:
        the parameter value of the appropriate data type or null.

    - #### isDefaultParameterValue

          public boolean isDefaultParameterValue(java.lang.String parameterName,
                                        java.lang.Object parameterValue)

      returns true if the value inParameterObj is the default value for the parameter indicated in param.
      Parameters:
        `parameterName` - the parameter name
        `parameterValue` - the parameter value
      Returns:
        true, if is default parameter value

    - #### getRegistrantName

          public java.lang.String getRegistrantName(java.lang.String identifier)

      The parameter is a CIK identifier. The returned value is a Registrant Name obtained from the parameters or null if there is not a value in the parameters
      Parameters:
        `identifier` - (a CIK)
      Returns:
        the registrant name from the parameters or null.

    - #### isDerivedFromDomainItemType

          public boolean isDerivedFromDomainItemType(XBRLItem item,
                                            boolean inStandardTaxonomy)

      Checks if is derived from domain item type.
      Parameters:
        `item` - the item
        `inStandardTaxonomy` - the in standard taxonomy
      Returns:
        true, if is derived from domain item type

    - #### validatePresentationNetworks

          public XBRLValidationReport validatePresentationNetworks(XMLFragment elDef)

      Validates EFM rule 6.12.3 An element used in an instance must participate in at least one effective presentation relationship in the DTS of that instance.
      Parameters:
        `elDef` - the el def
      Returns:
        the XBRL validation report

    - #### validatePresentationPreferredLabels

          public XBRLValidationReport validatePresentationPreferredLabels(XMLFragment elDef,
                                                                 java.util.HashSet<XMLFragment> processed)

      Validates EFM rule 6.12.3 An element used in an instance must participate in at least one effective presentation relationship in the DTS of that instance.
      Parameters:
        `elDef` - the el def
        `processed` - the processed
      Returns:
        the XBRL validation report

    - #### validateCalculationAndPresentation

          public XBRLValidationReport validateCalculationAndPresentation(XBRLItem fromItem,
                                                                XBRLItem toItem)

      6.14.5 If an instance contains non-empty facts for the source and target of an effective calculation relationship, then at least one effective presentation relationship that the source and target appear in (because of 6.12.3) must be either (a) a relationship with each other or (b) two relationships with any other elements that share a single extended link role. When facts participate in a calculation together, they must be shown with presentation relationships in the same relationship group, although not necessarily adjacent to each other.
      Parameters:
        `fromItem` - the from item
        `toItem` - the to item
      Returns:
        the XBRL validation report

    - #### validateAtMostOneAll

          public XBRLValidationReport validateAtMostOneAll(XMLElementDefinition elDef)

      Validate at most one all.
      Parameters:
        `elDef` - the el def
      Returns:
        the XBRL validation report

    - #### 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`