public abstract class XBRLDocument extends XMLDocumentURI
XBRLValidation.Direction| Modifier and Type | Field and Description |
|---|---|
static int |
INSTANCE
The Constant INSTANCE.
|
static int |
IXBRL
The Constant IXBRL.
|
static int |
LINKBASE
The Constant LINKBASE.
|
static int |
TAXONOMY
The Constant TAXONOMY.
|
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 and Description |
|---|
XBRLDocument(DTSContainer dts,
javax.xml.transform.Source xmlSource)
Creates an XBRLDocument form a Source object that can be used to
obtain the XML nodes of the document content.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExtendedLink(XBRLExtendedLink newExtendedLink)
Adds the extended link.
|
boolean |
addIdOfElement(XMLFragment newElement)
Adds the id of newElement to the set of IDs stored in this document.
|
boolean |
addIdOfElement(XMLFragment newElement,
java.lang.String id)
Adds the id of newElement to the set of IDs stored in this document.
|
void |
addParent(XBRLDocument parent)
Add a new XBRLDocument as parent of this document.
|
void |
changeElementId(XMLFragment newEl,
java.lang.String oldId,
java.lang.String newId)
Changes the key of an element in the internal itemsById hashtable but does not
change the id on the target element.
|
void |
changeExtendedLinkKey(net.sf.saxon.s9api.XdmNode oldKey,
net.sf.saxon.s9api.XdmNode newKey,
XBRLExtendedLink link)
Change extended link key.
|
void |
clear()
Frees-up used memory
This method should not be invoqued on live objects in the DTS.
|
static XMLDocumentURI |
createDocument(DTSContainer dts,
java.net.URI baseURI,
java.net.URI theURI,
javax.xml.transform.Source source,
boolean addToCache,
XBRLDTSDocument parent)
Creates a Document, (instance, taxonomy or linkbase)
by accessing the root element and looking at the document type
if the document is not a linkbase, schema or xbrl instance returns null.
|
static XMLDocumentURI |
createDocument(XMLDocumentURI node,
boolean addToCache)
Transforms the XMLDocumentURI in the node parameter into a XBRLDocument
Linkbase, Taxonomy or Instance depending on the root node .
|
void |
delParent(XBRLDocument parent)
Del parent.
|
abstract void |
discoverDTS(XBRLDTSDocument parent)
All derived classes MUST implement this method and provide the functionality according to section 3.2 of the
XBRL 2.1 specification
|
boolean |
equals(java.lang.Object oe)
Sets a new XPathFunctionResolver for this object.
|
abstract org.jdom.Document |
generateDocNode(boolean relativize,
java.net.URI base)
This class has to be implemented by objects derived from XBRLDocument
and must return a org.jdom.Document node with the content
of this XBRLDocument object
|
java.util.Iterator<java.lang.String> |
getAllUsedIds()
This method returns an iterator over all ids used by elements in this document.
|
java.util.Collection<java.lang.String> |
getComments()
Access to the comments in the file.
|
net.sf.saxon.s9api.XdmNode |
getDocument()
Returns the surrounding XML Node.
|
void |
getDTS()
Launches the rules for DTSDiscovery process that will eventually add more objects to the DTSContainer.
|
abstract int |
getDTSDocumentType()
Returns the type of DTS Document.
|
abstract java.lang.String |
getDTSDocumentTypeName()
Gets the DTS document type name.
|
XMLFragment |
getElementById(java.lang.String id)
This method returns the XMLFragment associated to the id received as
a parameter.
|
XBRLExtendedLink |
getExtendedLink(net.sf.saxon.s9api.XdmNode key)
Gets the extended link.
|
java.util.Iterator<XBRLExtendedLink> |
getExtendedLinks()
Returns an iterator over all extended links on this container.
|
java.util.Iterator<XBRLExtendedLink> |
getExtendedLinks(XBRLRoleType role)
Returns an iterator over all extended links on this container filtered by the
specific role type indicated in the role parameter.
|
java.util.Iterator<XBRLDocument> |
getParents()
Access to the [Parents] property.
|
int |
hashCode() |
boolean |
isContentModified()
Returns true if the document content has been modified.
|
boolean |
isDocumentModified()
Returns true if the content is in sync with the surrounding XML
and the document matches the content of the documentURI (the
document has not been changed or has been saved)
|
boolean |
isIdUsed(java.lang.String id)
This method returns true if the id indicated as a parameter corresponds to
an XMLFragment in this XBRLDocument.
|
static void |
moveNamespacesUp(org.jdom.Document jdomDocument)
Internal method used during serialization of XML files.
|
static void |
moveNamespacesUp(net.sf.saxon.tree.linked.DocumentImpl document)
Internal method used during serialization of XML files.
|
abstract void |
readInfoset()
Read all structures that builds the infoset.
|
void |
removeExtendedLink(XBRLExtendedLink link)
Removes the extended link.
|
void |
removeIdOfElement(XMLFragment element)
Removes the id of element.
|
void |
save(boolean relativize)
Save the file to the indicated document URI
Directories in the path of the file name are created automatically .
|
void |
setComments(java.util.Collection<java.lang.String> fileComments)
Sets a new collection of comments for this file.
|
void |
setDocumentAndReload(net.sf.saxon.s9api.XdmNode node)
This method is called by the XMLFragment object each time the surrounding XdmNode
object is set.
|
boolean |
updateXML(boolean relativize)
Updates the XML content of the XBRLDocument so the next call to save or to XdmNode getDocument() will
obtain a fresh copy with all changes made in the object library.
|
addChild, delChild, generateLocatorToDocument, getBase, getChildren, getDocumentURI, getDTSKey, getLocalFile, getValidationReport, invalidate, invalidate, isInDTS, isOnValidation, setURI, validateaddAttribute, 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, 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, setElements, setId, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setValue, setValue, setVariablesDefined, size, thin, toString, valueEquals, xEqualpublic static final int INSTANCE
public static final int TAXONOMY
public static final int LINKBASE
public static final int IXBRL
public XBRLDocument(DTSContainer dts, javax.xml.transform.Source xmlSource) throws net.sf.saxon.s9api.SaxonApiException
This creator just creates the XBRLDocument and passes sets the document content to the nodes read from the Source
dts - The DTSContainer under which the document will be createdxmlSource - the XML Sourcenet.sf.saxon.s9api.SaxonApiException - in case of problems reading the source documentpublic net.sf.saxon.s9api.XdmNode getDocument()
XMLFragmentgetDocument in class XMLFragmentpublic void setDocumentAndReload(net.sf.saxon.s9api.XdmNode node)
throws XBRLInconsistentDTSException,
com.rs.lic.LicenseVerificationException
XMLFragmentOverwrite this method in parent objects in order to refresh objects that depends on the surrounding XML nodes.
setDocumentAndReload in class XMLFragmentnode - the new XdmNodeXBRLInconsistentDTSException - the XBRL inconsistent dts exceptioncom.rs.lic.LicenseVerificationException - the license verification exceptionpublic boolean equals(java.lang.Object oe)
XMLFragmentequals in class XMLDocumentURIoe - the otherpublic int hashCode()
hashCode in class XMLDocumentURIpublic static XMLDocumentURI createDocument(DTSContainer dts, java.net.URI baseURI, java.net.URI theURI, javax.xml.transform.Source source, boolean addToCache, XBRLDTSDocument parent) throws DTSDiscoveryException, com.rs.lic.LicenseVerificationException
The Document may not be part of any DTS.
The Document is first obtained from the cache. If it is not there, then it is loaded from the URI and stored into the cache.
the source parameter is an javax.xml.transform.Source object from which the document will be generated
dts - the dtsbaseURI - the base uritheURI - the the urisource - the sourceaddToCache - the add to cacheparent - the parentDTSDiscoveryException - the DTS discovery exceptioncom.rs.lic.LicenseVerificationException - the license verification exceptionpublic static XMLDocumentURI createDocument(XMLDocumentURI node, boolean addToCache) throws com.rs.lic.LicenseVerificationException, DTSDiscoveryException
node - the XMLDocumentURI object to transformaddToCache - true if the document MUST be added to the cachecom.rs.lic.LicenseVerificationException - the license verification exceptionDTSDiscoveryException - the DTS discovery exceptionpublic abstract int getDTSDocumentType()
public abstract java.lang.String getDTSDocumentTypeName()
public abstract void discoverDTS(XBRLDTSDocument parent) throws DTSDiscoveryException, com.rs.lic.LicenseVerificationException
discoverDTS in interface XBRLDTSDocumentdiscoverDTS in class XMLDocumentURIparent - the parentDTSDiscoveryException - the DTS discovery exceptioncom.rs.lic.LicenseVerificationException - the license verification exceptionpublic abstract void readInfoset()
throws XBRLValidationException
XBRLValidationException - the XBRL validation exceptionpublic void getDTS()
throws DTSDiscoveryException,
com.rs.lic.LicenseVerificationException
DTSDiscoveryException - the DTS discovery exceptioncom.rs.lic.LicenseVerificationException - the license verification exceptionpublic java.util.Iterator<XBRLExtendedLink> getExtendedLinks()
public java.util.Iterator<XBRLExtendedLink> getExtendedLinks(XBRLRoleType role)
role - the XBRLRoleType for filteringpublic XBRLExtendedLink getExtendedLink(net.sf.saxon.s9api.XdmNode key) throws DTSDiscoveryException
key - the keyDTSDiscoveryException - the DTS discovery exceptionpublic void changeExtendedLinkKey(net.sf.saxon.s9api.XdmNode oldKey,
net.sf.saxon.s9api.XdmNode newKey,
XBRLExtendedLink link)
oldKey - the old keynewKey - the new keylink - the linkpublic void addExtendedLink(XBRLExtendedLink newExtendedLink)
newExtendedLink - the new extended linkpublic void removeExtendedLink(XBRLExtendedLink link)
link - the linkpublic java.util.Iterator<XBRLDocument> getParents()
public void addParent(XBRLDocument parent)
parent - the parentpublic void delParent(XBRLDocument parent)
parent - the parentpublic boolean addIdOfElement(XMLFragment newElement)
Don't call this method from inside XMLFragment.getId() or methods overridden by subclasses. Call
the addIdOfElement(XMLFragment, String) method instead.
newElement - element from which the ID will be obtainedpublic boolean addIdOfElement(XMLFragment newElement, java.lang.String id)
newElement - element to be added. The ID will not be obtained from the nodeid - to be set for this XMLFragment. The ID must be the real id set on this element node in the id attributepublic void removeIdOfElement(XMLFragment element)
element - the elementpublic void changeElementId(XMLFragment newEl, java.lang.String oldId, java.lang.String newId) throws XBRLInconsistentDTSException
newEl - element definitionoldId - the old idnewId - the new ID of the element in the tableXBRLInconsistentDTSException - the XBRL inconsistent dts exceptionpublic java.util.Iterator<java.lang.String> getAllUsedIds()
public boolean isIdUsed(java.lang.String id)
id - Stringpublic XMLFragment getElementById(java.lang.String id)
Subclasses of this class may contain methods that returns the appropriate object for an id. Use this method as a last resort if you don't know or you don't care about the returned object type.
id - string, the id of the element to retrievepublic void save(boolean relativize)
throws XBRLSerializationException
relativize - true if elements inside the file would be relative to the file or base URIXBRLSerializationException - the XBRL serialization exceptionpublic boolean isContentModified()
When the content is modified the surrounding XML document might not
be in sync with the object model. A call to updateXML(boolean)
will synchronize both models.
updateXML(boolean),
isDocumentModified()public boolean isDocumentModified()
isContentModified()public boolean updateXML(boolean relativize)
throws XBRLSerializationException
relativize - boolean value indicating if URLs (in locators, linkbaseRefs, etc...) will be relativized
using the document URL as a base URL.XBRLSerializationException - the XBRL serialization exceptionpublic static void moveNamespacesUp(org.jdom.Document jdomDocument)
jdomDocument - the jdom documentpublic static void moveNamespacesUp(net.sf.saxon.tree.linked.DocumentImpl document)
document - the documentpublic abstract org.jdom.Document generateDocNode(boolean relativize,
java.net.URI base)
throws XBRLSerializationException
relativize - boolean indicating if all URIs must be relativizedbase - URI the base uri to relativize other URIsXBRLSerializationException - the XBRL serialization exceptionpublic java.util.Collection<java.lang.String> getComments()
public void setComments(java.util.Collection<java.lang.String> fileComments)
fileComments - Collectionpublic void clear()
throws java.lang.Throwable
XMLFragmentThis 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.
clear in interface XBRLDTSDocumentclear in class XMLDocumentURIjava.lang.Throwable - the throwable