|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ihr.xbrl.om.XMLFragment
com.ihr.xbrl.om.XMLDocumentURI
com.ihr.xbrl.om.XBRLDocument
com.ihr.xbrl.om.instance.XBRLInstance
public class XBRLInstance
Class that encapsulates the content of an XBRL instance document Instance documents can be created via API calls or can be created from the content of an XML file
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation |
|---|
XBRLValidation.Direction |
| Field Summary | |
|---|---|
static javax.xml.namespace.QName |
docNodeName
The document node name |
| Fields inherited from class com.ihr.xbrl.om.XBRLDocument |
|---|
INSTANCE, IXBRL, LINKBASE, TAXONOMY |
| 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 | |
|---|---|
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)
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. |
|
| Method Summary | |
|---|---|
void |
add(int index,
XBRLFact fact)
|
boolean |
add(XBRLFact fact)
Adds a new fact to the end of this list of facts |
void |
addContext(XBRLContext ctx)
Adds a new context to the instance document. |
void |
addOrForwardItem(XBRLFactItem item)
Called internally to register new facts in the instance document |
void |
addUnit(XBRLUnit 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 |
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)
|
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()
|
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 Tthis 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 |
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)
|
java.util.Iterator<XBRLUnit> |
getUnits()
|
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()
|
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 |
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()
Access to the number of elements in the XBRLFactList |
| Methods inherited from class com.ihr.xbrl.om.XBRLDocument |
|---|
addExtendedLink, addIdOfElement, addIdOfElement, addParent, changeElementId, changeExtendedLinkKey, createDocument, createDocument, createDocument, delParent, getAllUsedIds, getComments, getDocument, getDTS, getElementById, getExtendedLink, getExtendedLinks, getExtendedLinks, getParents, isIdUsed, moveNamespacesUp, removeExtendedLink, removeIdOfElement, save, setComments, updateXML |
| Methods inherited from class com.ihr.xbrl.om.XMLDocumentURI |
|---|
addChild, delChild, generateLocatorToDocument, getBase, getChildren, getDocumentURI, getDTSKey, getLocalFile, getValidationReport, invalidate, invalidate, isInDTS, isOnValidation, validate |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ihr.xbrl.om.instance.XBRLFactsList |
|---|
evaluateList, getContainer, getDocument |
| Methods inherited from interface com.ihr.xbrl.om.XMLHasParent |
|---|
addXMLChild, getBase, removeXMLChild, setParent |
| Field Detail |
|---|
public static final javax.xml.namespace.QName docNodeName
| Constructor Detail |
|---|
public XBRLInstance(DTSContainer dts,
net.sf.saxon.s9api.XdmNode doc,
boolean bAddToCache)
throws DTSDiscoveryException
dts - doc - bAddToCache -
DTSDiscoveryExceptionpublic XBRLInstance(DTSContainer dts)
dts - The DTSContainer under which this instance is going to be created
public 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 -
DTSDiscoveryException
public 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 -
com.rs.lic.LicenseVerificationException
XBRLValidationException
public XBRLInstance(DTSContainer dts,
javax.xml.transform.Source xmlSource)
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 read
net.sf.saxon.s9api.SaxonApiException - in case of problems reading the Source
DTSDiscoveryException| Method Detail |
|---|
public int hashCode()
XBRLFactsList
hashCode in interface XBRLFactsListhashCode in class XBRLDocumentpublic boolean equals(java.lang.Object obj)
XMLFragment
equals in interface XBRLFactsListequals in class XBRLDocumentobj - Object to compare to
public XBRLInstance clone()
clone in class XMLFragment
public 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.Throwablepublic int getDTSDocumentType()
XBRLDocument
getDTSDocumentType in class XBRLDocumentpublic 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 XBRLFact
public void addContext(XBRLContext ctx)
throws XBRLInconsistentDTSException
ctx -
XBRLInconsistentDTSExceptionpublic 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 -
XBRLValidationException
public void delUnit(XBRLUnit unit)
throws XBRLInconsistentDTSException
unit -
XBRLInconsistentDTSException
public XBRLFact getFactById(java.lang.String id)
throws XBRLValidationException
id -
XBRLValidationExceptionpublic void merge(XBRLInstance otherInstance)
otherInstance - is the document to include into this document
java.net.MalformedURLException
XBRLValidationException
FormulaRuntimeException
public void setDocumentAndReload(net.sf.saxon.s9api.XdmNode node)
throws XBRLInconsistentDTSException,
com.rs.lic.LicenseVerificationException
setDocumentAndReload in class XBRLDocumentnode - the new XdmNode
XBRLInconsistentDTSException
com.rs.lic.LicenseVerificationException
public void optimize(DTSContainer dts,
boolean bRelativizeSchemaRefs,
boolean bGenerateSchemalocation)
bRelativizeSchemaRefs - turn the content of xlink:href relative to the documentURIbGenerateSchemalocation - creates a xsi:schemaLocation element
net.sf.saxon.trans.XPathExceptionpublic java.lang.String getDTSDocumentTypeName()
getDTSDocumentTypeName in class XBRLDocumentpublic net.sf.saxon.s9api.XdmValue getValue()
XMLFragment
getValue in class XMLFragment
public org.jdom.Document generateDocNode(boolean relativize,
java.net.URI base)
throws XBRLSerializationException
generateDocNode in class XBRLDocumentrelativize - boolean indicating if all URIs must be relativizedbase - URI the base uri to relativize other URIs
XBRLValidationException
XBRLSerializationException
public void setURI(java.net.URI newURI)
throws DTSDiscoveryException
XMLDocumentURI
setURI in class XMLDocumentURInewURI - URI
DTSDiscoveryException
public void discoverDTS(XBRLDTSDocument parent)
throws DTSDiscoveryException,
com.rs.lic.LicenseVerificationException
discoverDTS in interface XBRLDTSDocumentdiscoverDTS in class XBRLDocumentcom.rs.lic.LicenseVerificationException
DTSDiscoveryExceptionpublic java.util.Iterator<XBRLContext> getContexts()
Note that the serialization process will eliminate duplicate contexts automatically if they exists.
public int getNumberOfContexts()
XBRLValidationExceptionpublic 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, optional
XBRLValidationExceptionaddXBRLDocument(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 java.util.Iterator<java.net.URI> getXBRLDocuments(int type)
type - can be XBRLDocument.TAXONOMY or XBRLDocument.LINKBASE
XBRLRuntimeException - encapsulating XBRLValidationExceptions in the rare case where the document has not been validated and contains XBRL Validation
errorspublic void delXBRLDocument(XBRLDocument doc)
doc - the XBRLTaxonomy or XBRLLinkbase to detach
public java.util.Iterator<java.net.URI> getDTSs()
throws XBRLValidationException
java.net.MalformedURLException
XBRLValidationException
public XBRLContext getContextById(java.lang.String id)
throws XBRLValidationException
XBRLValidationException
public XBRLUnit getUnitById(java.lang.String id)
throws XBRLValidationException
XBRLValidationException
public void readInfoset()
throws XBRLValidationException
XBRLDocument
readInfoset in class XBRLDocumentXBRLValidationException
public void addUnit(XBRLUnit unit)
throws XBRLInconsistentDTSException
unit -
XBRLValidationException
XBRLInconsistentDTSExceptionpublic java.util.Iterator<XMLFragment> getElements()
XMLFragment
getElements in class XMLFragmentpublic java.lang.String getXPathToRoot()
XMLFragment
getXPathToRoot in interface XBRLFactsListgetXPathToRoot in class XMLFragmentpublic boolean add(XBRLFact fact)
XBRLFactsList
add in interface XBRLFactsList
public void add(int index,
XBRLFact fact)
add in interface XBRLFactsListpublic XBRLInstance getInstance()
XBRLFactsList
getInstance in interface XBRLFactsListpublic java.util.Iterator<java.util.Vector<XBRLFactItem>> getItems()
XBRLFactsList
getItems in interface XBRLFactsListpublic java.util.Iterator<XBRLFactItem> getItems(XBRLItem itemFrom)
XBRLFactsList
getItems in interface XBRLFactsListitemFrom - XBRLItem
public 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()
XBRLFactsList
getTuples in interface XBRLFactsListpublic java.util.Iterator<XBRLFactItem> getItemsSg(XBRLItem itemFrom)
XBRLFactsList
getItemsSg in interface XBRLFactsListitemFrom - XBRLItem
public java.util.Iterator<XBRLFactTuple> getTuplesSg(XBRLTuple tupleFrom)
XBRLFactsList
getTuplesSg in interface XBRLFactsListpublic java.util.Iterator<XBRLFactTuple> getTuples(XBRLTuple tupleFrom)
XBRLFactsList
getTuples in interface XBRLFactsListtupleFrom - XBRLTuple
public java.util.Iterator<XBRLFact> iterator()
iterator in interface XBRLFactsListpublic int getNumberOfTuples()
XBRLFactsList
getNumberOfTuples in interface XBRLFactsListpublic boolean remove(XBRLFact fact)
XBRLFactsList
remove in interface XBRLFactsListpublic void setParent(XBRLFactsList parent)
XBRLFactsList
setParent in interface XBRLFactsListpublic void addOrForwardItem(XBRLFactItem item)
XBRLFactsList
addOrForwardItem in interface XBRLFactsListpublic int size()
XBRLFactsList
size in interface XBRLFactsListpublic int indexOf(XBRLFact fact)
XBRLFactsList
indexOf in interface XBRLFactsListfact - XBRLFact
public int indexOf(XBRLFact fact,
int index)
XBRLFactsList
indexOf in interface XBRLFactsListfact - XBRLFactindex - integer
public XBRLFact get(int index)
XBRLFactsList
get in interface XBRLFactsListindex - integer
public static boolean isIXBRL(XMLDocumentURI node)
node -
public void clearDTSReferences()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||