com.ihr.xbrl.om.formula

## Class XBRLVariableResource

- java.lang.Object
- - com.ihr.xbrl.om.XMLFragment
  - - com.ihr.xbrl.om.exLinks.XLinkElement
    - - com.ihr.xbrl.om.exLinks.XBRLPointerOfARelationship
      - - com.ihr.xbrl.om.exLinks.XBRLResource
        - - com.ihr.xbrl.om.formula.XBRLFormulaResource
          - - com.ihr.xbrl.om.formula.XBRLVariableResource

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, XBRLRelationshipPoint, HasFormulaProcessor, XBRLVariableFormulaEvaluable, Thinable, XBRLValidation, XBRLValueKey, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
  Direct Known Subclasses:
    XBRLVariableFact, XBRLVariableGeneral, XBRLVariableParameter

      public abstract class XBRLVariableResource
      extends XBRLFormulaResource
      implements XBRLVariableFormulaEvaluable

  The Class XBRLVariableResource.
  Author:
    Ignacio

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation

      `XBRLValidation.Direction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static javax.xml.namespace.QName` | `as` The Constant as.
    `static javax.xml.namespace.QName` | `bindAsSequence` The Constant bindAsSequence.
    `static org.apache.log4j.Logger` | `log` The log.
    `static javax.xml.namespace.QName` | `name` The Constant name.
    `static javax.xml.namespace.QName` | `order` The Constant order.

    - ### Fields inherited from class com.ihr.xbrl.om.exLinks.XBRLResource

      `nullResource`

    - ### Fields inherited from class com.ihr.xbrl.om.exLinks.XLinkElement

      `actuate, ACTUATE, ARC, arcrole, ARCROLE, ETITLE, EXTENDED, from, FROM, href, HREF, label, LABEL, LOCATOR, RESOURCE, role, ROLE, show, SHOW, SIMPLE, title, TITLE, to, TO, TYPE`

    - ### Fields inherited from class com.ihr.xbrl.om.XMLFragment

      `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 Summary

    Constructors
    Constructor and Description
    `XBRLVariableResource(XBRLFormulaProcessor proc, XBRLExtendedLink parent, net.sf.saxon.s9api.XdmNode resNode)` Instantiates a new XBRL variable resource.
    `XBRLVariableResource(XBRLFormulaProcessor proc, XBRLResource res)` Instantiates a new XBRL variable resource.
    `XBRLVariableResource(XBRLFormulaResource other)` Instantiates a new XBRL variable resource.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `net.sf.saxon.s9api.XdmValue` | `adjustValueAccordingToType(net.sf.saxon.s9api.XdmValue val, net.sf.saxon.s9api.XdmItem item)` Checks if the variable has a "as" attribute and: * if it exist; the value in the item parameter is converted to the type indicated * if it does not exist; the value of the val parameter is returned.
    `boolean` | `bindAsSequence()` In the case of resource based variables this reads the surrounding syntax and returns the value of the bindAsSequence.
    `void` | `clear()` Removes all referneces to this resource in the DTS.
    `int` | `getAllAspectsFiltered()` Access to all aspects filtered as an integer constant.
    `abstract java.lang.String` | `getExpression()` Used only for debug purposes.
    `java.util.List<XBRLFilterUse>` | `getFilters(int aspect)` Gets the filters.
    `java.util.Set<java.lang.Integer>` | `getKeysAspectsFiltered()` Gets the keys aspects filtered.
    `XBRLVariableResourceUse` | `getUse(XBRLRelationship rel, XBRLVariablesHolder set)` Creates a new XBRLVariableResourceUse instance for this variable resource in the variable resource set.
    `XBRLVariableType` | `getVariableType()` Gets the variable type.
    `boolean` | `hasFilterAspect(int aspect, javax.xml.namespace.QName dimName)` Checks for filter aspect.

    - ### Methods inherited from class com.ihr.xbrl.om.formula.XBRLFormulaResource

      `getProcessor`

    - ### Methods inherited from class com.ihr.xbrl.om.exLinks.XBRLResource

      `addChild, equals, generateLocatorToNode, generateNode, getAttributes, getDTSBase, getFriendlyName, getFriendlyName, getParent, getResourceIdentifier, getRoleType, getType, getValidationReport, getValueKey, hashCode, invalidate, invalidate, isComplexType, isOnValidation, isSimpleType, setComplexType, setDTSBase, setId, setParent, setRole, setRoleType, setSimpleType, setValue, validate`

    - ### Methods inherited from class com.ihr.xbrl.om.exLinks.XLinkElement

      `getActuate, getArcrole, getFromTxt, getHRef, getLabel, getRole, getShow, getStaticLabel, getSType, getTitle, getToTxt, isRequiredAttribute, isValidAttribute, setActuate, setArcrole, setFrom, setHRef, setLabel, setShow, setSType, setTitle, setTo`

    - ### Methods inherited from class com.ihr.xbrl.om.XMLFragment

      `addAttribute, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clone, clone, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAllAttributes, getAttribute, getAttributeBooleanValue, getAttributeQNameValue, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, 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, 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, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setValue, setVariablesDefined, size, thin, toString, valueEquals, xEqual`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.ihr.xbrl.om.formula.XBRLVariableFormulaEvaluable

      `checkVariable, evaluateValue, getProcessor, getVariablesRequired, getXMLFragment, rawEvaluateValue`

    - ### Methods inherited from interface com.ihr.xbrl.om.exLinks.XBRLRelationshipPoint

      `addFromRelationship, addToRelationship, getFromRelationships, getToRelationships, removeFromRelationship, removeToRelationship`

- - ### Field Detail

    - #### log

          public static org.apache.log4j.Logger log

      The log.

    - #### name

          public static final javax.xml.namespace.QName name

      The Constant name.

    - #### order

          public static final javax.xml.namespace.QName order

      The Constant order.

    - #### bindAsSequence

          public static final javax.xml.namespace.QName bindAsSequence

      The Constant bindAsSequence.

    - #### as

          public static final javax.xml.namespace.QName as

      The Constant as.

  - ### Constructor Detail

    - #### XBRLVariableResource

          public XBRLVariableResource(XBRLFormulaProcessor proc,
                              XBRLExtendedLink parent,
                              net.sf.saxon.s9api.XdmNode resNode)

      Instantiates a new XBRL variable resource.
      Parameters:
        `proc` - the proc
        `parent` - the parent
        `resNode` - the res node

    - #### XBRLVariableResource

          public XBRLVariableResource(XBRLFormulaProcessor proc,
                              XBRLResource res)

      Instantiates a new XBRL variable resource.
      Parameters:
        `proc` - the proc
        `res` - the res

    - #### XBRLVariableResource

          public XBRLVariableResource(XBRLFormulaResource other)

      Instantiates a new XBRL variable resource.
      Parameters:
        `other` - the other

  - ### Method Detail

    - #### getUse

          public XBRLVariableResourceUse getUse(XBRLRelationship rel,
                                       XBRLVariablesHolder set)
                                         throws XFValidationException

      Creates a new XBRLVariableResourceUse instance for this variable resource in the variable resource set.
      Parameters:
        `rel` - Relationship that links the set with the variable
        `set` - the XBRLVariableSetResource that contains this variable use
      Returns:
        new instance of an XBRLVariableResourceUse
      Throws:
        `XFValidationException` - in the form of a XFxbrlveVariableNameResolutionFailure

    - #### bindAsSequence

          public boolean bindAsSequence()

      Description copied from interface: `XBRLVariableFormulaEvaluable`
      In the case of resource based variables this reads the surrounding syntax and returns the value of the bindAsSequence.

      In other cases relays on the implementation

      Specified by:
        `bindAsSequence` in interface `XBRLVariableFormulaEvaluable`
      Returns:
        true, if successful

    - #### getFilters

          public java.util.List<XBRLFilterUse> getFilters(int aspect)

      Gets the filters.
      Specified by:
        `getFilters` in interface `XBRLVariableFormulaEvaluable`
      Parameters:
        `aspect` - the aspect
      Returns:
        the filters

    - #### getKeysAspectsFiltered

          public java.util.Set<java.lang.Integer> getKeysAspectsFiltered()

      Gets the keys aspects filtered.
      Returns:
        the keys aspects filtered

    - #### getAllAspectsFiltered

          public int getAllAspectsFiltered()

      Access to all aspects filtered as an integer constant. return value is defined in CommonAspectRule class
      Returns:
        integer constant. bitmap
      See Also:
        `CommonAspectRule`

    - #### hasFilterAspect

          public boolean hasFilterAspect(int aspect,
                                javax.xml.namespace.QName dimName)

      Checks for filter aspect.
      Specified by:
        `hasFilterAspect` in interface `XBRLVariableFormulaEvaluable`
      Parameters:
        `aspect` - the aspect
        `dimName` - if aspect is DIMENSION then dimName is the dimension name
      Returns:
        true, if successful

    - #### adjustValueAccordingToType

          public net.sf.saxon.s9api.XdmValue adjustValueAccordingToType(net.sf.saxon.s9api.XdmValue val,
                                                               net.sf.saxon.s9api.XdmItem item)
                                                                 throws XFValidationException

      Checks if the variable has a "as" attribute and: * if it exist; the value in the item parameter is converted to the type indicated * if it does not exist; the value of the val parameter is returned.
      Specified by:
        `adjustValueAccordingToType` in interface `XBRLVariableFormulaEvaluable`
      Parameters:
        `val` - value to be returned when no "as" attribute exist on variable
        `item` - the value that must be converted to the type indicated in the as attribute
      Returns:
        XdmValue (atomic) or the value of the val parameter
      Throws:
        `XFValidationException` - the XF validation exception

    - #### getVariableType

          public XBRLVariableType getVariableType()

      Description copied from interface: `XBRLVariableFormulaEvaluable`
      Gets the variable type.
      Specified by:
        `getVariableType` in interface `XBRLVariableFormulaEvaluable`
      Returns:
        the variable type

    - #### getExpression

          public abstract java.lang.String getExpression()

      Used only for debug purposes.

      Returns the XPath expression used to evaluate this variable

      Returns:
        String

    - #### clear

          public void clear()

      Description copied from class: `XBRLResource`
      Removes all referneces to this resource in the DTS.
      Specified by:
        `clear` in interface `XBRLVariableFormulaEvaluable`
      Overrides:
        `clear` in class `XBRLResource`