com.ihr.xbrl.om
Class XMLDocumentURI

java.lang.Object
  extended by com.ihr.xbrl.om.XMLFragment
      extended by com.ihr.xbrl.om.XMLDocumentURI
All Implemented Interfaces:
XBRLRelationshipPoint, 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, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, idQName, NO_POSITION, OrderComparator, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER
 
Constructor Summary
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 embeded linkbases 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
 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 the resulting 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
 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, getAttribute, getAttributeQNameValue, getAttributes, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, getFragment, getFriendlyName, getFriendlyName, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getId, getLang, getNamespaceURI, getNodeName, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getParent, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getStringValue, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolveHRef, resolveHRef, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setId, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setValue, setValue, setVariablesDefined, 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 embeded linkbases 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.

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

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

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

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

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 the resulting URI

Specified by:
getBase in interface XMLHasParent
Overrides:
getBase in class XMLFragment
Returns:
URI

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 -

delChild

public void delChild(XMLDocumentURI child)
Removes a child document from the list of document children

Parameters:
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
Throws:
DTSDiscoveryException
com.rs.lic.LicenseVerificationException

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

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.

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.


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa