com.ihr.xbrl.om

## Class XMLDocumentURI

- java.lang.Object
- - com.ihr.xbrl.om.XMLFragment
  - - com.ihr.xbrl.om.XMLDocumentURI

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, XBRLRelationshipPoint, Thinable, XBRLDTSDocument, XBRLHasDTSTarget, XBRLValidation, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
  Direct Known Subclasses:
    XBRLDocument

      public class XMLDocumentURI
      extends XMLFragment
      implements XBRLDTSDocument, XBRLValidation, XBRLHasDTSTarget

  This class represents an XML Document that exist in a DTS.

  A XMLDocumentURI has a document key, a document URI and a set of child documents.

  Author:
    Ignacio

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation

      `XBRLValidation.Direction`

  - ### Field Summary

    - ### Fields inherited from class com.ihr.xbrl.om.XMLFragment

      `CONCEPT_LABEL, CONCEPT_QNAME, EASY_TO_READ, ELEMENT_LABEL, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, HIDE_COMMON_ACCURACY, idQName, NO_POSITION, OrderComparator, OrderComparator2, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLDocumentURI(DTSContainer dts, java.net.URI baseURI, java.net.URI theURI, javax.xml.transform.Source source, boolean bAddToCache, XBRLDTSDocument parent)` Create a DocumentURI from the cache or reading it from the supplied URI if it is not in the cache.
    `XMLDocumentURI(DTSContainer dts, net.sf.saxon.s9api.XdmNode extendedLinkNode)` For embedded link bases or creation of XBRLDocuments from a XML Source This creator just creates a new XMLFragment and assigns it to the XdmNode received as a parameter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChild(XMLDocumentURI child)` Add a new clid to this document list of children.
    `void` | `clear()` Frees-up used memory This method should not be invoqued on live objects in the DTS.
    `void` | `delChild(XMLDocumentURI child)` Removes a child document from the list of document children.
    `void` | `discoverDTS(XBRLDTSDocument parent)` Fires the rules of DTS Discovery for this object.
    `boolean` | `equals(java.lang.Object obj)` Sets a new XPathFunctionResolver for this object.
    `XBRLLocator` | `generateLocatorToDocument(boolean relativize, java.net.URI base)` Creates an XBRLLocator pointing to this document URI.
    `java.net.URI` | `getBase()` Search for an attribute called xml:base on this node and returns a resolved URI considering the content of the xml:base in ancestor nodes and the document URI.
    `java.util.Iterator<XMLDocumentURI>` | `getChildren()` Access to the Children property.
    `java.net.URI` | `getDocumentURI()` Every DocumentURI has a unique URI except embeded linkbases this function returns the document URI or null for embeded linkbases When an instance document is created from nodes, this property value is also null.
    `java.net.URI` | `getDTSKey()` Provides a key that can be used to index the document in the cache.
    `java.io.File` | `getLocalFile()` Provides the local file name on the file system even if the surrounding file has systemID of the official URL on the Internet. or null if the source does not have that information stored.
    `XBRLValidationReport` | `getValidationReport()` Access to the last stored validation report.
    `int` | `hashCode()`
    `void` | `invalidate()` Invalidates the XBRLFact for XBRL validation.
    `boolean` | `invalidate(XBRLValidation.Direction dir)` Invalidates this object and the elements in the XML tree according with the parameter in dir This method is used by GUI tools that requires to reset validation before a manual validation cycle is started.
    `boolean` | `isInDTS(java.net.URI target)` Returns true if the document pointed to by the URI can be discovered in the DTS that would result using this document as the Starting point for DTS Discovery.
    `boolean` | `isOnValidation()` When validation is a recursive process, this function returns true if the object going to be validated is already under validation.
    `void` | `setURI(java.net.URI uri)` Sets the value of the URI of this XMLDocumentURI If the document is in the cache and the supplied URI is not null or is different from the original URI this method throws an XBRLInternalErrorException.
    `XBRLValidationReport` | `validate(XBRLPlugInProcessor proc)` Executes validation on the instance object and returns a validation report.

    - ### Methods inherited from class com.ihr.xbrl.om.XMLFragment

      `addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clone, clone, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNode, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAllAttributes, getAttribute, getAttributeBooleanValue, getAttributeQNameValue, getAttributes, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, getElementsHashCode, getFragment, getFriendlyName, getFriendlyName, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getGenericLabelText, getId, getLang, getNamespaceURI, getNodeName, getNumberOfAttributes, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getParent, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticContext, getStaticNamespace, getStringValue, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathExecutable, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, isXdmDocumentAttached, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolve_equal2, resolveHRef, resolveHRef, s_equal2, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setId, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setValue, setValue, setVariablesDefined, size, thin, toString, valueEquals, xEqual`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### XMLDocumentURI

          public XMLDocumentURI(DTSContainer dts,
                        java.net.URI baseURI,
                        java.net.URI theURI,
                        javax.xml.transform.Source source,
                        boolean bAddToCache,
                        XBRLDTSDocument parent)
                         throws DTSDiscoveryException

      Create a DocumentURI from the cache or reading it from the supplied URI if it is not in the cache. Reads the whole document
      Parameters:
        `dts` - the DTSContainer object this new object will belongs to
        `baseURI` - the base URI of document
        `theURI` - the document URI to read
        `source` - source form where to read the document. If null then the document is obtained form the indicated URI
        `bAddToCache` - true if the document will be added to the cache of documents read
        `parent` - optional (may be null) URL of parent document in order to property create error messages
      Throws:
        `DTSDiscoveryException` - if an error occurs

    - #### XMLDocumentURI

          public XMLDocumentURI(DTSContainer dts,
                        net.sf.saxon.s9api.XdmNode extendedLinkNode)

      For embedded link bases or creation of XBRLDocuments from a XML Source

      This creator just creates a new XMLFragment and assigns it to the XdmNode received as a parameter.

      This creator does not add the DocumentURI to the cache

      This method is also used by the IXBRLProcessor when a new XMLDocumentURI has to be created from the content of the transformed nodes (XBRL Report just extracted) so it can be used to build a new XBRLInstance without using the SchemaAware configuration object. This way, the XBRLInstance is transformed into the schema aware configuration object at a later time when changeConf is normally executed.

      Remember to call `setURI(URI)` and assign a URI after this instance is created and before calling load and using this XBRLDocumentURI

      Parameters:
        `dts` - DTSContainer
        `extendedLinkNode` - is the element in the xl:extended substitution group. The node that identifies the linkbase type

  - ### Method Detail

    - #### clear

          public void clear()
                     throws java.lang.Throwable

      Description copied from class: `XMLFragment`
      Frees-up used memory

      This method should not be invoqued on live objects in the DTS. It is automatically invoqued by the API when an object is no longer used and referenced by other objects. It is save not to call it directly.

      Specified by:
        `clear` in interface `XBRLDTSDocument`
      Overrides:
        `clear` in class `XMLFragment`
      Throws:
        `java.lang.Throwable` - the throwable

    - #### getLocalFile

          public java.io.File getLocalFile()

      Provides the local file name on the file system even if the surrounding file has systemID of the official URL on the Internet. or null if the source does not have that information stored.
      Returns:
        File or null
      Since:
        2.6.10

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `XMLFragment`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Description copied from class: `XMLFragment`
      Sets a new XPathFunctionResolver for this object.
      Overrides:
        `equals` in class `XMLFragment`
      Parameters:
        `obj` - the other
      Returns:
        true, if successful

    - #### setURI

          public void setURI(java.net.URI uri)
                      throws DTSDiscoveryException

      Sets the value of the URI of this XMLDocumentURI If the document is in the cache and the supplied URI is not null or is different from the original URI this method throws an XBRLInternalErrorException.
      Parameters:
        `uri` - URI
      Throws:
        `DTSDiscoveryException` - the DTS discovery exception

    - #### getDocumentURI

          public java.net.URI getDocumentURI()

      Every DocumentURI has a unique URI except embeded linkbases this function returns the document URI or null for embeded linkbases

      When an instance document is created from nodes, this property value is also null.

      Returns:
        the URI of this document

    - #### getBase

          public java.net.URI getBase()

      Description copied from class: `XMLFragment`
      Search for an attribute called xml:base on this node and returns a resolved URI considering the content of the xml:base in ancestor nodes and the document URI.
      Specified by:
        `getBase` in interface `XMLHasParent`
      Overrides:
        `getBase` in class `XMLFragment`
      Returns:
        URI absolute

    - #### getChildren

          public java.util.Iterator<XMLDocumentURI> getChildren()

      Access to the Children property.
      Specified by:
        `getChildren` in interface `XBRLHasDTSTarget`
      Returns:
        Iterator

    - #### addChild

          public void addChild(XMLDocumentURI child)

      Add a new clid to this document list of children.
      Parameters:
        `child` - the child

    - #### delChild

          public void delChild(XMLDocumentURI child)

      Removes a child document from the list of document children.
      Parameters:
        `child` - the child

    - #### discoverDTS

          public void discoverDTS(XBRLDTSDocument parent)
                           throws DTSDiscoveryException,
                                  com.rs.lic.LicenseVerificationException

      Description copied from interface: `XBRLDTSDocument`
      Fires the rules of DTS Discovery for this object.
      Specified by:
        `discoverDTS` in interface `XBRLDTSDocument`
      Parameters:
        `parent` - the parent
      Throws:
        `DTSDiscoveryException` - the DTS discovery exception
        `com.rs.lic.LicenseVerificationException` - the license verification exception

    - #### getDTSKey

          public java.net.URI getDTSKey()

      Description copied from interface: `XBRLDTSDocument`
      Provides a key that can be used to index the document in the cache.
      Specified by:
        `getDTSKey` in interface `XBRLDTSDocument`
      Returns:
        URI

    - #### generateLocatorToDocument

          public XBRLLocator generateLocatorToDocument(boolean relativize,
                                              java.net.URI base)
                                                throws XBRLSerializationException

      Creates an XBRLLocator pointing to this document URI.
      Parameters:
        `relativize` - if true, xlink:href will be relative to base URI
        `base` - URI for relativization
      Returns:
        XBRLLocator
      Throws:
        `XBRLSerializationException` - the XBRL serialization exception

    - #### isInDTS

          public boolean isInDTS(java.net.URI target)

      Returns true if the document pointed to by the URI can be discovered in the DTS that would result using this document as the Starting point for DTS Discovery.
      Parameters:
        `target` - the URI of the XBRL Document to check
      Returns:
        boolean

    - #### getValidationReport

          public XBRLValidationReport getValidationReport()

      Description copied from interface: `XBRLValidation`
      Access to the last stored validation report.
      Specified by:
        `getValidationReport` in interface `XBRLValidation`
      Returns:
        XBRLValidationReport or null if the object has not been validated or no errors exists

    - #### validate

          public XBRLValidationReport validate(XBRLPlugInProcessor proc)

      Description copied from interface: `XBRLValidation`
      Executes validation on the instance object and returns a validation report.

      The validation result may be cached internally. A call to `XBRLValidation.invalidate(Direction)` clears the validation cache.

      Specified by:
        `validate` in interface `XBRLValidation`
      Parameters:
        `proc` - the processor under which the object is going to be validated. Note the same object can be validated on multiple processors.
      Returns:
        the validation report or null if no errors.

    - #### invalidate

          public void invalidate()

      Description copied from interface: `XBRLValidation`
      Invalidates the XBRLFact for XBRL validation.
      Specified by:
        `invalidate` in interface `XBRLValidation`

    - #### invalidate

          public boolean invalidate(XBRLValidation.Direction dir)

      Description copied from interface: `XBRLValidation`
      Invalidates this object and the elements in the XML tree according with the parameter in dir

      This method is used by GUI tools that requires to reset validation before a manual validation cycle is started.

      Specified by:
        `invalidate` in interface `XBRLValidation`
      Parameters:
        `dir` - see the `XBRLValidation.Direction` enumeration for more information.
      Returns:
        true, if successful

    - #### isOnValidation

          public boolean isOnValidation()

      Description copied from interface: `XBRLValidation`
      When validation is a recursive process, this function returns true if the object going to be validated is already under validation. This prevents a recursive loop to enter the same validation component in an infinite loop.
      Specified by:
        `isOnValidation` in interface `XBRLValidation`
      Returns:
        true if the document is under validation. Means, the validation has not finished.