public class XBRLContext extends XMLFragment implements java.lang.Cloneable, XBRLValidation, Thinable
An XBRL Context contains:
| Content | Description |
|---|---|
| XBRLEntity | Content about the reporting entity |
| XBRLPeriod | Content about the reporting period, instant or duration |
| XBRLScenario | Content about the reporting scenario. Collection of XML nodes |
XBRLValidation.Direction| Modifier and Type | Field and Description |
|---|---|
static javax.xml.namespace.QName |
contextNode
The QName of the XML element that is the container of context information.
|
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 |
|---|
XBRLContext(DTSContainer dts,
XBRLEntity entity,
XBRLPeriod period,
XBRLScenario scenario)
Creates a new context with the supplied entity, period and scenario.
|
XBRLContext(XBRLContext other)
Creates a new context as a copy or clone of the context supplied as a parameter
The new context will have null as parent instance.
|
XBRLContext(XBRLInstance parent,
XBRLEntity entity,
XBRLPeriod period,
XBRLScenario scenario)
Creates a new context with the supplied entity, period and scenario and set the parent to the parent instance.
|
XBRLContext(XBRLInstance parent,
net.sf.saxon.s9api.XdmNode root)
Creates a new context with the supplied XdmNode.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addXMLChild(XMLHasParent newChild)
Adds the xml child.
|
void |
clear()
Frees-up used memory
This method should not be invoqued on live objects in the DTS.
|
XBRLContext |
clone() |
XBRLContext |
clone(DTSContainer newDTS)
Clone.
|
boolean |
equals(java.lang.Object other)
Evaluates c-equality of two contexts according to the XBRL 2.1 spec
The context IDs may be different and are not compared
|
org.jdom.Element |
generateNode(boolean relativize,
java.net.URI base)
Serializes to a jdom Element the representation of the properties of this Information Item
This method should be called from classes derived from this class
|
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.
|
XBRLEntity |
getEntity()
Obtains the entity associated with this context or null.
|
java.lang.String |
getFriendlyName()
Returns a string description that represents the element content in a form
that users can understand.
|
java.lang.String |
getFriendlyName(int modifiers,
LabelsProvider lp)
Returns a string description that represents the element content in a form
that users can understand.
|
java.lang.String |
getFriendlyNameOnlyId()
Gets the friendly name only id.
|
XBRLInstance |
getParent()
The parent XMLFragment node of this XMLFragment node.
|
XBRLPeriod |
getPeriod()
obtains the period of this context.
|
XBRLScenario |
getScenario()
Returns the scenario for this context.
|
XBRLValidationReport |
getValidationReport()
Access to the last stored validation report.
|
net.sf.saxon.s9api.XdmValue |
getValue()
Returns the value of this node.
|
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 |
isOnValidation()
When validation is a recursive process, this function returns true if the
object going to be validated is already under validation.
|
void |
removeXMLChild(XMLHasParent child)
Removes the xml child.
|
boolean |
s_equal2(java.lang.Object other)
Resolves s_equal2 comparison of this node against the other node.
|
void |
setEntity(XBRLEntity entity)
Sets the entity for this context
this method resets validation of the context.
|
void |
setId(java.lang.String id)
Sets the content of the id attribute of this element
the ID MUST not have any space, but null is allowed and removes an
id from an XML Fragment.
|
void |
setParent(XMLHasParent instance)
Sets the parent of this context to the instance document specified in the
parameter.
|
void |
setPeriod(XBRLPeriod period)
Sets the period of this context
this method resets validation status of this context.
|
void |
setScenario(XBRLScenario scenario)
Sets the new scenario for this context
using this method resets validation flag.
|
void |
thin()
Removes from memory all objects that can be obtained back from the surrounding XML
nodes or can be calculated again from other sources.
|
XBRLValidationReport |
validate(XBRLPlugInProcessor proc)
Executes validation on the instance object and returns a validation report.
|
addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, changeBase, checkBase, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAllAttributes, getAttribute, getAttributeBooleanValue, getAttributeQNameValue, getAttributes, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElementsHashCode, getFragment, 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, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, isXdmDocumentAttached, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, resetElements, resetHash, resolve_equal2, resolveHRef, resolveHRef, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setRegenerateNodeIfnotFound, setValue, setValue, setVariablesDefined, size, toString, valueEquals, xEqualpublic static final javax.xml.namespace.QName contextNode
public XBRLContext(XBRLInstance parent, net.sf.saxon.s9api.XdmNode root) throws XBRLInconsistentDTSException
parent - - The XBRLInstance object that is the parent of this contextroot - - The XdmNode for this contextXBRLInconsistentDTSException - the XBRL inconsistent dts exceptionpublic XBRLContext(DTSContainer dts, XBRLEntity entity, XBRLPeriod period, XBRLScenario scenario)
dts - - The container DTS, MUST not be nullentity - - The entity, may be nullperiod - - The period, may be nullscenario - - The scenario, may be nullpublic XBRLContext(XBRLInstance parent, XBRLEntity entity, XBRLPeriod period, XBRLScenario scenario)
parent - - The parent XBRLInstance documententity - - The entity, may be nullperiod - - The period, may be nullscenario - - The scenario, may be nullpublic XBRLContext(XBRLContext other)
other - the context to clonepublic 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 class XMLFragmentjava.lang.Throwable - the throwablepublic void thin()
Thinablethin in interface Thinablethin in class XMLFragmentpublic void setId(java.lang.String id)
throws XBRLInconsistentDTSException
XMLFragmentsetId in class XMLFragmentid - the new IDXBRLInconsistentDTSException - if the id is not lexicographically validpublic XBRLContext clone()
clone in class XMLFragmentpublic XBRLContext clone(DTSContainer newDTS)
XMLFragmentclone in class XMLFragmentnewDTS - the new dtspublic boolean equals(java.lang.Object other)
equals in class XMLFragmentother - the otherpublic boolean s_equal2(java.lang.Object other)
XMLFragments_equal2 in class XMLFragmentother - The other node (preferably an XMLFragment) that contains a non null NodeInfo document.public int hashCode()
hashCode in class XMLFragmentpublic XBRLPeriod getPeriod()
public void setPeriod(XBRLPeriod period)
period - the new periodpublic XBRLEntity getEntity()
public void setEntity(XBRLEntity entity)
entity - the new entitypublic XBRLScenario getScenario()
public void setScenario(XBRLScenario scenario)
scenario - the new scenariopublic org.jdom.Element generateNode(boolean relativize,
java.net.URI base)
throws XBRLSerializationException
XMLFragmentgenerateNode in class XMLFragmentrelativize - boolean indicating if URIs should be relativized to the base URI (see next argument)base - the URI to which some attributes of this object should be relatividedXBRLSerializationException - the XBRL serialization exceptionpublic net.sf.saxon.s9api.XdmValue getValue()
XMLFragmentgetValue in class XMLFragmentpublic void setParent(XMLHasParent instance) throws XBRLInconsistentDTSException
setParent in interface XMLHasParentsetParent in class XMLFragmentinstance - XBRLInstanceXBRLInconsistentDTSException - if the context contains facts in a previous unattached instancepublic void addXMLChild(XMLHasParent newChild) throws XBRLInconsistentDTSException
XMLHasParentaddXMLChild in interface XMLHasParentaddXMLChild in class XMLFragmentnewChild - the childXBRLInconsistentDTSException - the XBRL inconsistent dts exceptionpublic void removeXMLChild(XMLHasParent child)
XMLHasParentremoveXMLChild in interface XMLHasParentremoveXMLChild in class XMLFragmentchild - the childpublic XBRLInstance 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 XMLHasParentgetParent in class XMLFragmentpublic java.util.Iterator<XMLFragment> getElements()
XMLFragmentgetElements in class XMLFragmentpublic java.lang.String getFriendlyName()
XMLFragmentRemarks, this method may return very long names not suitable for user interface
getFriendlyName in class XMLFragmentpublic java.lang.String getFriendlyName(int modifiers,
LabelsProvider lp)
XMLFragmentThis function accepts flags that are defined as constants in XMLFragment in order to modify the output.
getFriendlyName in class XMLFragmentmodifiers - integerlp - the lppublic java.lang.String getFriendlyNameOnlyId()
public XBRLValidationReport getValidationReport()
XBRLValidationgetValidationReport in interface XBRLValidationpublic XBRLValidationReport validate(XBRLPlugInProcessor proc)
XBRLValidation
The validation result may be cached internally. A call to XBRLValidation.invalidate(Direction) clears the validation cache.
validate in interface XBRLValidationproc - the processor under which the object is going to be validated. Note the same object can be validated on multiple processors.public void invalidate()
XBRLValidationinvalidate in interface XBRLValidationpublic boolean invalidate(XBRLValidation.Direction dir)
XBRLValidationThis method is used by GUI tools that requires to reset validation before a manual validation cycle is started.
invalidate in interface XBRLValidationdir - see the XBRLValidation.Direction enumeration for more information.public boolean isOnValidation()
XBRLValidationisOnValidation in interface XBRLValidation