public class XBRLInstance extends XBRLDocument implements XBRLFactsList, java.lang.Cloneable
XBRLValidation.Direction| Modifier and Type | Field and Description |
|---|---|
static javax.xml.namespace.QName |
docNodeName
The document node name.
|
INSTANCE, IXBRL, LINKBASE, TAXONOMYCONCEPT_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 |
|---|
XBRLInstance(DTSContainer dts)
Creates a new empty instance document.
|
XBRLInstance(DTSContainer[] dtss)
Creates a new empty instance document and creates
link:schemaRef and link:linkbaseRef elements to all root URIs of the
DTSContainers received as a parameter.
|
XBRLInstance(DTSContainer dts,
javax.xml.transform.Source xmlSource,
boolean deepProcess)
Creates an instance document
and obtains the content from a javax.xml.transform.Source object
The Document URI of this instance will be set to the systemId of the Source
provided as a parameter.
|
XBRLInstance(DTSContainer dts,
net.sf.saxon.s9api.XdmNode doc,
boolean bAddToCache)
Creates an instance document and sets the document content to the supplied XdmNode.
|
XBRLInstance(XMLDocumentURI d,
boolean bAddToCache)
Creates a new empty instance document according to the configuration object received.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
XBRLFact fact)
Adds the.
|
boolean |
add(XBRLFact fact)
Adds a new fact to the end of this list of facts.
|
boolean |
addContext(XBRLContext ctx)
Adds a new context to the instance document.
|
void |
addFactToCache(XBRLFact fact)
Adds the fact to cache.
|
void |
addOrForwardItem(XBRLFactItem item)
Called internally to register new facts in the instance document.
|
boolean |
addUnit(XBRLUnit unit)
Adds the unit.
|
void |
addXBRLDocument(XBRLDocument doc,
XBRLRoleAndArcroleTypes roleOrArcrole)
Attach a new XBRLDocument directly in the instance regardless it is
alreary somewhere under the wood of the DTS.
|
void |
addXBRLDocumentIfNotInDTS(XBRLDocument doc,
XBRLRoleAndArcroleTypes roleOrArcrole)
Attach a new XBRLDocument to the instance document using
a linkbaseRef or schemaRed only if the document
is not in already in the set of documents that can be discovered from
this instance document existing DTS entries.
|
void |
clear()
Frees-up used memory
This method should not be invoqued on live objects in the DTS.
|
void |
clearDTSReferences()
Removes all schemas, linkbases, roleRefs, arcroleRefs etc in the DTS of this instance document.
|
XBRLInstance |
clone() |
void |
copyHistory(XBRLInstance fromInstance)
This method copy all history details from instance in the fromInstance parameter
to facts in this instance document.
|
void |
delContext(XBRLContext ctx)
Removes a context from the instance document.
|
void |
delUnit(XBRLUnit unit)
Removes an unit from the instance document.
|
void |
delXBRLDocument(XBRLDocument doc)
Detach an XBRLDocument from the set of XBRLDocuments to include in this
instance's DTS.
|
void |
discoverDTS(XBRLDTSDocument parent)
This process MUST not use Schema Aware XPath expressions
and MUST be limited to the elements that cause DTS Discovery.
|
boolean |
equals(java.lang.Object obj)
Sets a new XPathFunctionResolver for this object.
|
org.jdom.Document |
generateDocNode(boolean relativize,
java.net.URI base)
Generates a JDOM representation of the instance document
obtains information from the internal objects and not from the
NodeInfo document.
|
XBRLFact |
get(int index)
Returns the element at the selected index position.
|
XBRLFact |
getCacheFact(net.sf.saxon.s9api.XdmNode factNode)
This function access to a fact item by its surrounding XdmNode.
|
XBRLContext |
getContextById(java.lang.String id)
Gets the context by id.
|
XBRLContext |
getContextCompatible(XBRLContext otherContext)
Returns an existing context that is c-equal to the context passed in as the parameter.
|
java.util.Iterator<XBRLContext> |
getContexts()
Access to all contexts in the XBRL Instance.
|
int |
getDTSDocumentType()
Returns the type of DTS Document.
|
java.lang.String |
getDTSDocumentTypeName()
Gets the DTS document type name.
|
java.util.Iterator<java.net.URI> |
getDTSs()
Obtains an iterator over the URIs of files that are in the DTS of this instance document.
|
java.util.Iterator<XMLFragment> |
getElements()
For complex type resources this returns an iterator with all children XML fragments
This method may be overwriten by other classes in the hierarchy.
|
XBRLFact |
getFactById(java.lang.String id)
find the element with the correspondent id and return the instance
or tuple pointed to.
|
XBRLInstance |
getInstance()
Access to the instance document on the top of this facts container hierarchy.
|
java.util.Iterator<java.util.Vector<XBRLFactItem>> |
getItems()
Iterator over the items on this facts container.
|
java.util.Iterator<XBRLFactItem> |
getItems(XBRLItem itemFrom)
Iterator over fact items that are instances of the XBRLItem received as a parameter.
|
java.util.Iterator<XBRLFactItem> |
getItemsSg(XBRLItem itemFrom)
Iterator over fact items that are instances of the XBRLItem received as a parameter of in the substitution group of that item.
|
int |
getNumberOfContexts()
Returns the number of contexts in this instance document.
|
int |
getNumberOfTuples()
Calculates and returns the number of tuples children of this facts container .
|
int |
getNumberOfUnits()
Returns the number of units in this instance document.
|
XBRLFactsList |
getParent()
The parent XMLFragment node of this XMLFragment node.
|
java.util.Iterator<java.util.Vector<XBRLFactTuple>> |
getTuples()
Iterator over the tuples on this facts container.
|
java.util.Iterator<XBRLFactTuple> |
getTuples(XBRLTuple tupleFrom)
Iterator over fact tuples that are instances of the XBRLTuple received as a parameter.
|
java.util.Iterator<XBRLFactTuple> |
getTuplesSg(XBRLTuple tupleFrom)
Iterator over fact tuples that are instances of the XBRLTuple received as a parameter of in the substitution group of that tuple.
|
XBRLUnit |
getUnitById(java.lang.String id)
Gets the unit by id.
|
XBRLUnit |
getUnitCompatible(XBRLUnit otherUnit)
Returns an existing unit that is u-equal to the unit passed in as the parameter.
|
java.util.Iterator<XBRLUnit> |
getUnits()
Gets the units.
|
net.sf.saxon.s9api.XdmValue |
getValue()
Returns the value of this node.
|
java.util.Iterator<java.net.URI> |
getXBRLDocuments(int type)
Returns an iterator over documents included in the DTS by this instance that are of the specified type.
|
java.lang.String |
getXPathToRoot()
Returns an XPath 2.0 expression to locate this document's node starting at this document's root
This function updates the local namespace context if nodes in the path requires new namespaces
to be declared.
|
int |
hashCode()
This is from the Object interface and must be implemented by sub classes
in order to be able to provide hashCodes.
|
int |
indexOf(XBRLFact fact)
Returns the index position of a fact within this list.
|
int |
indexOf(XBRLFact fact,
int index)
Returns the index position of a fact within this list starting
at the position indicated by the index parameter.
|
static boolean |
isIXBRL(XMLDocumentURI node)
Returns true if the XMLDocumentURI is an iXBRL document.
|
java.util.Iterator<XBRLFact> |
iterator()
Iterator.
|
void |
merge(XBRLInstance otherInstance)
Add to this instance document all the facts and contexts from the instance
document in the parameter.
|
void |
optimize(DTSContainer dts,
boolean bRelativizeSchemaRefs,
boolean bGenerateSchemalocation)
Optimize the instance document by removing unused elements
|
void |
readInfoset()
Read all structures that builds the infoset.
|
boolean |
remove(XBRLFact fact)
Removes a fact from the facts container.
|
void |
setDocumentAndReload(net.sf.saxon.s9api.XdmNode node)
If the content is changed then update the internal objects.
|
void |
setModified()
When a fact is edited this method is called
to reflect that the nodes shall be generated again.
|
void |
setOptimizations(boolean optimizations)
This flag sets how the process of generating the XML nodes will work
either removing unused contexts or keeping all generated contexts there
during a call to generateDocNode.
|
void |
setParent(XBRLFactsList parent)
Sets the parent of this facts container to a new parent.
|
void |
setURI(java.net.URI newURI)
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.
|
int |
size()
For complex type resources this returns the number of children elements that all are XML fragments
This method may be overwriten by other classes in the hierarchy.
|
void |
unsetModified()
Marks the instance as not modified.
|
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.
|
addExtendedLink, addIdOfElement, addIdOfElement, addParent, changeElementId, changeExtendedLinkKey, createDocument, createDocument, delParent, getAllUsedIds, getComments, getDocument, getDTS, getElementById, getExtendedLink, getExtendedLinks, getExtendedLinks, getParents, isContentModified, isDocumentModified, isIdUsed, moveNamespacesUp, moveNamespacesUp, removeExtendedLink, removeIdOfElement, save, setCommentsaddChild, delChild, generateLocatorToDocument, getBase, getChildren, getDocumentURI, getDTSKey, getLocalFile, getValidationReport, invalidate, invalidate, isInDTS, isOnValidation, validateaddAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, 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, getElementsHashCode, getFragment, getFriendlyName, getFriendlyName, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getGenericLabelText, getId, getLang, getNamespaceURI, getNodeName, getNumberOfAttributes, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticContext, getStaticNamespace, getStringValue, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getXPathExecutable, getXPathNamespaceContext, getXPathToNode, 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, thin, toString, valueEquals, xEqualevaluateList, getContainer, getDocument, isXdmDocumentAttachedaddXMLChild, getBase, removeXMLChild, setParentpublic static final javax.xml.namespace.QName docNodeName
public XBRLInstance(DTSContainer dts, net.sf.saxon.s9api.XdmNode doc, boolean bAddToCache) throws DTSDiscoveryException
dts - the dtsdoc - the docbAddToCache - the b add to cacheDTSDiscoveryException - the DTS discovery exceptionpublic XBRLInstance(DTSContainer dts)
dts - The DTSContainer under which this instance is going to be createdpublic XBRLInstance(XMLDocumentURI d, boolean bAddToCache) throws DTSDiscoveryException
This is an internal method and should not be used by applications. This method is called
from the XBRLDocument.createDocument(XMLDocumentURI, boolean) method during the
creation of an XBRL Instance document.
This constructor is also used by clone() with bAddToCache set to false
d - XMLDocumentURI to transform into an XBRLInstance objectbAddToCache - the b add to cacheDTSDiscoveryException - the DTS discovery exceptionpublic XBRLInstance(DTSContainer[] dtss) throws com.rs.lic.LicenseVerificationException
This method was created to facilitate instance document creation inside the formula linkbase.
The incoming DTS are all merged into a new DTSContainer
dtss - the dtsscom.rs.lic.LicenseVerificationException - the license verification exceptionpublic XBRLInstance(DTSContainer dts, javax.xml.transform.Source xmlSource, boolean deepProcess) throws net.sf.saxon.s9api.SaxonApiException, DTSDiscoveryException
The Document URI of this instance will be set to the systemId of the Source provided as a parameter. The Source will be transformed into XML nodes and the nodes will be the new document content.
dts - The DTSContainer under which the instance document is going to be createdxmlSource - The Source of the XML nodes to be readdeepProcess - boolean, true if the xmlSource is schema validated and nodes can be processed. false otherwisenet.sf.saxon.s9api.SaxonApiException - in case of problems reading the SourceDTSDiscoveryException - the DTS discovery exceptionpublic int hashCode()
XBRLFactsListhashCode in interface XBRLFactsListhashCode in class XBRLDocumentpublic boolean equals(java.lang.Object obj)
XMLFragmentequals in interface XBRLFactsListequals in class XBRLDocumentobj - the otherpublic XBRLInstance clone()
clone in class XMLFragmentpublic 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 XBRLFactsListclear in interface XBRLDTSDocumentclear in class XBRLDocumentjava.lang.Throwable - the throwablepublic int getDTSDocumentType()
XBRLDocumentgetDTSDocumentType in class XBRLDocumentpublic void addFactToCache(XBRLFact fact)
fact - the factpublic boolean updateXML(boolean relativize)
throws XBRLSerializationException
XBRLDocumentupdateXML in class XBRLDocumentrelativize - 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 XBRLFact getCacheFact(net.sf.saxon.s9api.XdmNode factNode)
At this stage, the use of this method is only possible for instance documents obtained from the serialized form (XML files).
factNode - as key to obtain the XBRLFactpublic boolean addContext(XBRLContext ctx) throws XBRLInconsistentDTSException
ctx - the ctxXBRLInconsistentDTSException - the XBRL inconsistent dts exceptionpublic XBRLContext getContextCompatible(XBRLContext otherContext)
otherContext - the other contextpublic XBRLUnit getUnitCompatible(XBRLUnit otherUnit)
otherUnit - the other unitpublic void delContext(XBRLContext ctx)
The context should not have fact items in this instance document before it is removed.
All facts in the instance document using this context will be removed from the instance
ctx - the ctxpublic void delUnit(XBRLUnit unit) throws XBRLInconsistentDTSException
unit - the unitXBRLInconsistentDTSException - the XBRL inconsistent dts exceptionpublic XBRLFact getFactById(java.lang.String id) throws XBRLValidationException
id - the idXBRLValidationException - the XBRL validation exceptionpublic void merge(XBRLInstance otherInstance)
otherInstance - is the document to include into this documentpublic void setDocumentAndReload(net.sf.saxon.s9api.XdmNode node)
throws XBRLInconsistentDTSException,
com.rs.lic.LicenseVerificationException
setDocumentAndReload in class XBRLDocumentnode - the new document and reloadXBRLInconsistentDTSException - the XBRL inconsistent dts exceptioncom.rs.lic.LicenseVerificationException - the license verification exceptionpublic void optimize(DTSContainer dts, boolean bRelativizeSchemaRefs, boolean bGenerateSchemalocation)
dts - the dtsbRelativizeSchemaRefs - turn the content of xlink:href relative to the documentURIbGenerateSchemalocation - creates a xsi:schemaLocation elementpublic java.lang.String getDTSDocumentTypeName()
XBRLDocumentgetDTSDocumentTypeName in class XBRLDocumentpublic net.sf.saxon.s9api.XdmValue getValue()
XMLFragmentgetValue in class XMLFragmentpublic void setOptimizations(boolean optimizations)
optimizations - the new optimizationspublic org.jdom.Document generateDocNode(boolean relativize,
java.net.URI base)
throws XBRLSerializationException
generateDocNode in class XBRLDocumentrelativize - the relativizebase - the baseXBRLSerializationException - the XBRL serialization exceptionpublic void setURI(java.net.URI newURI)
throws DTSDiscoveryException
XMLDocumentURIsetURI in class XMLDocumentURInewURI - URIDTSDiscoveryException - the DTS discovery exceptionpublic void discoverDTS(XBRLDTSDocument parent) throws DTSDiscoveryException, com.rs.lic.LicenseVerificationException
discoverDTS in interface XBRLDTSDocumentdiscoverDTS in class XBRLDocumentparent - the parentDTSDiscoveryException - the DTS discovery exceptioncom.rs.lic.LicenseVerificationException - the license verification exceptionpublic java.util.Iterator<XBRLContext> getContexts()
Note that the serialization process will eliminate duplicate contexts automatically if they exists.
public int getNumberOfContexts()
public int getNumberOfUnits()
public java.util.Iterator<XBRLUnit> getUnits()
public void addXBRLDocumentIfNotInDTS(XBRLDocument doc, XBRLRoleAndArcroleTypes roleOrArcrole) throws XBRLValidationException
The document to attach MUST have a URI. The roleOrArcrole parameter may be null and is null in if the doc parameter is a taxonomy schema.
doc - the new XBRLTaxonomy or XBRLLinkbase to attachroleOrArcrole - XBRLRoleAndArcroleTypes, optionalXBRLValidationException - the XBRL validation exceptionaddXBRLDocument(XBRLDocument, XBRLRoleAndArcroleTypes)public void addXBRLDocument(XBRLDocument doc, XBRLRoleAndArcroleTypes roleOrArcrole)
doc - the new XBRLTaxonomy or XBRLLinkbase to attachroleOrArcrole - XBRLRoleAndArcroleTypes can be null and is null for taxonomy and linkbase documentsaddXBRLDocumentIfNotInDTS(XBRLDocument, XBRLRoleAndArcroleTypes)public void setModified()
public void unsetModified()
public java.util.Iterator<java.net.URI> getXBRLDocuments(int type)
type - can be XBRLDocument.TAXONOMY or XBRLDocument.LINKBASEpublic void delXBRLDocument(XBRLDocument doc)
doc - the XBRLTaxonomy or XBRLLinkbase to detachpublic java.util.Iterator<java.net.URI> getDTSs()
throws XBRLValidationException
XBRLValidationException - the XBRL validation exceptionpublic XBRLContext getContextById(java.lang.String id) throws XBRLValidationException
id - the idXBRLValidationException - the XBRL validation exceptionpublic XBRLUnit getUnitById(java.lang.String id) throws XBRLValidationException
id - the idXBRLValidationException - the XBRL validation exceptionpublic void readInfoset()
throws XBRLValidationException
XBRLDocumentreadInfoset in class XBRLDocumentXBRLValidationException - the XBRL validation exceptionpublic boolean addUnit(XBRLUnit unit) throws XBRLInconsistentDTSException
unit - the unitXBRLInconsistentDTSException - the XBRL inconsistent dts exceptionpublic java.util.Iterator<XMLFragment> getElements()
XMLFragmentgetElements in class XMLFragmentpublic java.lang.String getXPathToRoot()
XMLFragmentgetXPathToRoot in interface XBRLFactsListgetXPathToRoot in class XMLFragmentpublic boolean add(XBRLFact fact)
XBRLFactsListadd in interface XBRLFactsListfact - the factpublic void add(int index,
XBRLFact fact)
XBRLFactsListadd in interface XBRLFactsListindex - the indexfact - the factpublic XBRLInstance getInstance()
XBRLFactsListgetInstance in interface XBRLFactsListpublic java.util.Iterator<java.util.Vector<XBRLFactItem>> getItems()
XBRLFactsListgetItems in interface XBRLFactsListpublic java.util.Iterator<XBRLFactItem> getItems(XBRLItem itemFrom)
XBRLFactsListgetItems in interface XBRLFactsListitemFrom - XBRLItempublic XBRLFactsList getParent()
XMLFragmentFor XBRLAttribute nodes, the parent is the element node.
For Document nodes the returned value is null
For Embedded document nodes, the returned value is the parent element node.
getParent in interface XBRLFactsListgetParent in interface XMLHasParentgetParent in class XMLFragmentpublic java.util.Iterator<java.util.Vector<XBRLFactTuple>> getTuples()
XBRLFactsListgetTuples in interface XBRLFactsListpublic java.util.Iterator<XBRLFactItem> getItemsSg(XBRLItem itemFrom)
XBRLFactsListgetItemsSg in interface XBRLFactsListitemFrom - XBRLItempublic java.util.Iterator<XBRLFactTuple> getTuplesSg(XBRLTuple tupleFrom)
XBRLFactsListgetTuplesSg in interface XBRLFactsListtupleFrom - the tuple frompublic java.util.Iterator<XBRLFactTuple> getTuples(XBRLTuple tupleFrom)
XBRLFactsListgetTuples in interface XBRLFactsListtupleFrom - XBRLTuplepublic java.util.Iterator<XBRLFact> iterator()
XBRLFactsListiterator in interface XBRLFactsListpublic int getNumberOfTuples()
XBRLFactsListgetNumberOfTuples in interface XBRLFactsListpublic boolean remove(XBRLFact fact)
XBRLFactsListremove in interface XBRLFactsListfact - the factpublic void setParent(XBRLFactsList parent)
XBRLFactsListsetParent in interface XBRLFactsListparent - the new parentpublic void addOrForwardItem(XBRLFactItem item)
XBRLFactsListaddOrForwardItem in interface XBRLFactsListitem - the itempublic int size()
XMLFragmentsize in interface XBRLFactsListsize in class XMLFragmentpublic int indexOf(XBRLFact fact)
XBRLFactsListindexOf in interface XBRLFactsListfact - XBRLFactpublic int indexOf(XBRLFact fact, int index)
XBRLFactsListindexOf in interface XBRLFactsListfact - XBRLFactindex - integerpublic XBRLFact get(int index)
XBRLFactsListget in interface XBRLFactsListindex - integerpublic static boolean isIXBRL(XMLDocumentURI node)
node - the nodepublic void clearDTSReferences()
public void copyHistory(XBRLInstance fromInstance)
fromInstance - the instance document whose facts history is going to be copied into this instance facts