com.ihr.xbrl.om.assertions

## Class XBRLConsistencyAssertion

- 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.assertions.XBRLConsistencyAssertion

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, AssertionEvaluationLocal, EvaluableAssertion, HasAssertionId, XBRLRelationshipPoint, XBRLMessageContext, HasFormulaProcessor, HasUncoveredAspectValueResolver, StaticCheck, XBRLVariablesHolder, Thinable, XBRLValidation, XBRLValueKey, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext

      public class XBRLConsistencyAssertion
      extends XBRLFormulaResource
      implements EvaluableAssertion, StaticCheck, AssertionEvaluationLocal, XBRLVariablesHolder, HasAssertionId, XBRLMessageContext, HasUncoveredAspectValueResolver

  The Class XBRLConsistencyAssertion.
  Author:
    Ignacio

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `XBRLConsistencyAssertion.ConsistencyAssertionType` Indicates the type of the Consistency Assertion.
    `static class` | `XBRLConsistencyAssertion.XFConsistencyAssertionInvalidFact` The Class XFConsistencyAssertionInvalidFact.

    - ### 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` | `absoluteAcceptanceRadiusQName` The Constant absoluteAcceptanceRadiusQName.
    `static javax.xml.namespace.QName` | `ca_absolute_acceptance_radius_expression` Used for the creation of messages.
    `static javax.xml.namespace.QName` | `ca_acceptance_radius` Used for the creation of messages.
    `static javax.xml.namespace.QName` | `ca_aspect_matched_facts` Used for the creation of messages.
    `static javax.xml.namespace.QName` | `ca_proportional_acceptance_radius_expression` Used for the creation of messages.
    `static javax.xml.namespace.QName` | `proportionalAcceptanceRadiusQName` The Constant proportionalAcceptanceRadiusQName.
    `static javax.xml.namespace.QName` | `resourceName` The Constant resourceName.
    `static javax.xml.namespace.QName` | `strict` The Constant strict.

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

    - ### Fields inherited from interface com.ihr.xbrl.om.formula.XBRLVariablesHolder

      `MODEL_DIMENSIONAL, MODEL_NON_DIMENSIONAL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBRLConsistencyAssertion(XBRLFormulaProcessor proc, XBRLExtendedLink parent, net.sf.saxon.s9api.XdmNode resNode)` Instantiates a new XBRL consistency assertion.
    `XBRLConsistencyAssertion(XBRLFormulaProcessor proc, XBRLResource other)` Instantiates a new XBRL consistency assertion.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `collectAssertionVariablenames(java.util.HashSet<javax.xml.namespace.QName> allVars)` Collect assertion variablenames.
    `XBRLAssertionResult[]` | `evaluateAssertion(XBRLInstance doc)` Required for evaluating the assertion.
    `XBRLAssertionResult[]` | `evaluateAssertionType(XBRLInstance instance)` Evaluate assertion type.
    `java.lang.String` | `getAbsoluteAcceptanceRadius()` Gets the absolute acceptance radius.
    `int` | `getAspectModel()` Returns either XBRLVariablesHolder.MODEL_DIMENSIONAL or XBRLVariablesHolder.MODEL_NON_DIMENSIONAL
    `net.sf.saxon.s9api.XdmItem` | `getAssertionContextItem()` Gets the assertion context item.
    `java.lang.String` | `getAssertionID()` Returns a text identifying the assertion from the linkbase syntax. this is either the value of the id attribute or the value of the xlink:label on the resource
    `java.util.Collection<? extends XBRLVariableResourceUse>` | `getAssertionMessageVariables()` Gets the assertion message variables.
    `java.util.Collection<net.sf.saxon.s9api.QName>` | `getBindableVariableNames()` Access to a collection of QNames (Saxon s9api QNames) of all variables that are defined in this XBRLVariablesHolder
    `XBRLConsistencyAssertion.ConsistencyAssertionType` | `getConsistencyAssertionType()` Gets the consistency assertion type.
    `java.lang.String` | `getErrorIdentification()` Returns an string that identifies the assertion when an error is produced.
    `java.lang.String` | `getExpression()` Access to the xpath expression for this consistency assertion.
    `java.util.Collection<XBRLFilterUse>` | `getFilters()` Returns a collection of XBRLFilterUse instance representing the use of filters associated to this XBRLVariablesHolder.
    `java.lang.String` | `getProportionalAcceptanceRadius()` Gets the proportional acceptance radius.
    `XBRLResource` | `getResource()` Returns the XBRLResource that contains the definition of the assertion.
    `net.sf.saxon.s9api.XdmValue` | `getUncoveredAspectValue(int aspect, javax.xml.namespace.QName dimName)` Used only for the implementation of the xff.uncovered-aspect(aspect, dimName) XPath function
    `XBRLVariableFormulaEvaluable` | `getVariableResource(javax.xml.namespace.QName variableName)` Access to the variable resource by its variable name.
    `XBRLVariableResourceUse` | `getVariableUse(javax.xml.namespace.QName variableName)` Obtains the instance of the XBRLVariableResourceUse on this variable set using the variable name.
    `net.sf.saxon.s9api.XdmValue` | `getVariableValue(javax.xml.namespace.QName variableName)` Access to the variable value using the variable name.
    `XFIImplicitFilterOptimizer` | `getXFIImplicitFilterOptimizer()` Returns or creates the instance of the fact variable optimizer when the fact variable is used with implicit filtering in a set with more than 2 variables.
    `boolean` | `isImplicitFilter()` Returns true if the variable set shall require implicit filtering.
    `boolean` | `isStrict()` Checks if is strict.
    `void` | `setAbsoluteAcceptanceRadius(java.lang.String expression)` Sets the absolute acceptance radius.
    `void` | `setProportionalAcceptanceRadius(java.lang.String expression)` Sets the proportional acceptance radius.
    `void` | `staticCheck()` Resources that has static checking implements this interface.

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

      `getProcessor`

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

      `addChild, clear, 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.assertions.EvaluableAssertion

      `getLabel`

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

      `getProcessor`

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

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

- - ### Field Detail

    - #### resourceName

          public static final javax.xml.namespace.QName resourceName

      The Constant resourceName.

    - #### proportionalAcceptanceRadiusQName

          public static final javax.xml.namespace.QName proportionalAcceptanceRadiusQName

      The Constant proportionalAcceptanceRadiusQName.

    - #### absoluteAcceptanceRadiusQName

          public static final javax.xml.namespace.QName absoluteAcceptanceRadiusQName

      The Constant absoluteAcceptanceRadiusQName.

    - #### strict

          public static final javax.xml.namespace.QName strict

      The Constant strict.

    - #### ca_aspect_matched_facts

          public static final javax.xml.namespace.QName ca_aspect_matched_facts

      Used for the creation of messages.

    - #### ca_acceptance_radius

          public static final javax.xml.namespace.QName ca_acceptance_radius

      Used for the creation of messages.

    - #### ca_absolute_acceptance_radius_expression

          public static final javax.xml.namespace.QName ca_absolute_acceptance_radius_expression

      Used for the creation of messages.

    - #### ca_proportional_acceptance_radius_expression

          public static final javax.xml.namespace.QName ca_proportional_acceptance_radius_expression

      Used for the creation of messages.

  - ### Constructor Detail

    - #### XBRLConsistencyAssertion

          public XBRLConsistencyAssertion(XBRLFormulaProcessor proc,
                                  XBRLExtendedLink parent,
                                  net.sf.saxon.s9api.XdmNode resNode)
                                   throws XFValidationException

      Instantiates a new XBRL consistency assertion.
      Parameters:
        `proc` - the proc
        `parent` - the parent
        `resNode` - the res node
      Throws:
        `XFValidationException` - the XF validation exception

    - #### XBRLConsistencyAssertion

          public XBRLConsistencyAssertion(XBRLFormulaProcessor proc,
                                  XBRLResource other)
                                   throws XFValidationException

      Instantiates a new XBRL consistency assertion.
      Parameters:
        `proc` - the proc
        `other` - the other
      Throws:
        `XFValidationException` - the XF validation exception

  - ### Method Detail

    - #### setProportionalAcceptanceRadius

          public void setProportionalAcceptanceRadius(java.lang.String expression)

      Sets the proportional acceptance radius.
      Parameters:
        `expression` - the new proportional acceptance radius

    - #### getProportionalAcceptanceRadius

          public java.lang.String getProportionalAcceptanceRadius()

      Gets the proportional acceptance radius.
      Returns:
        the String text expression in the proportionalAcceptanceRadius attribute or null if the attribute is not defined in the resource or has not been set using the `setProportionalAcceptanceRadius(String)` method

    - #### getAbsoluteAcceptanceRadius

          public java.lang.String getAbsoluteAcceptanceRadius()

      Gets the absolute acceptance radius.
      Returns:
        the String text expression in the absoluteAcceptanceRadius attribute or null if the attribute is not defined in the resource or has not been set using the `setAbsoluteAcceptanceRadius(String)` method

    - #### setAbsoluteAcceptanceRadius

          public void setAbsoluteAcceptanceRadius(java.lang.String expression)

      Sets the absolute acceptance radius.
      Parameters:
        `expression` - the new absolute acceptance radius

    - #### getConsistencyAssertionType

          public XBRLConsistencyAssertion.ConsistencyAssertionType getConsistencyAssertionType()

      Gets the consistency assertion type.
      Returns:
        the type of this consistency assertion derived from the content of the proportionalAcceptanceRadiusExpression and absoluteAcceptanceRadius attributes.

    - #### evaluateAssertionType

          public XBRLAssertionResult[] evaluateAssertionType(XBRLInstance instance)
                                                      throws XFValidationException

      Description copied from interface: `AssertionEvaluationLocal`
      Evaluate assertion type.
      Specified by:
        `evaluateAssertionType` in interface `AssertionEvaluationLocal`
      Parameters:
        `instance` - the instance
      Returns:
        the XBRL assertion result[]
      Throws:
        `XFValidationException` - the XF validation exception

    - #### getAssertionID

          public java.lang.String getAssertionID()

      Returns a text identifying the assertion from the linkbase syntax. this is either the value of the id attribute or the value of the xlink:label on the resource
      Specified by:
        `getAssertionID` in interface `HasAssertionId`
      Returns:
        the Assertion ID

    - #### staticCheck

          public void staticCheck()
                           throws XFValidationException

      Description copied from interface: `StaticCheck`
      Resources that has static checking implements this interface. During resource compilation time the static check is evaluated.

      In case of errors, the staticCheck method raises XFValidationException

      Specified by:
        `staticCheck` in interface `StaticCheck`
      Throws:
        `XFValidationException` - if static errors occurs

    - #### isStrict

          public boolean isStrict()

      Checks if is strict.
      Returns:
        true, if is strict

    - #### getAspectModel

          public int getAspectModel()

      Description copied from interface: `XBRLVariablesHolder`
      Returns either XBRLVariablesHolder.MODEL_DIMENSIONAL or XBRLVariablesHolder.MODEL_NON_DIMENSIONAL
      Specified by:
        `getAspectModel` in interface `XBRLVariablesHolder`
      Returns:
        one of the two constants

    - #### getBindableVariableNames

          public java.util.Collection<net.sf.saxon.s9api.QName> getBindableVariableNames()

      Description copied from interface: `XBRLVariablesHolder`
      Access to a collection of QNames (Saxon s9api QNames) of all variables that are defined in this XBRLVariablesHolder
      Specified by:
        `getBindableVariableNames` in interface `XBRLVariablesHolder`
      Returns:
        the bindable variable names

    - #### getFilters

          public java.util.Collection<XBRLFilterUse> getFilters()

      Description copied from interface: `XBRLVariablesHolder`
      Returns a collection of XBRLFilterUse instance representing the use of filters associated to this XBRLVariablesHolder. Used while checking variables in order to obtain global filters
      Specified by:
        `getFilters` in interface `XBRLVariablesHolder`
      Returns:
        the filters

    - #### getVariableUse

          public XBRLVariableResourceUse getVariableUse(javax.xml.namespace.QName variableName)

      Obtains the instance of the XBRLVariableResourceUse on this variable set using the variable name.

      The constructor of the XBRLVariableSetResource already calls readVariables so it is almost impossible this method raises XFRuntimeException

      Parameters:
        `variableName` - the variable name
      Returns:
        instance of XBRLVariableResourceUse or null if none exist

    - #### getVariableResource

          public XBRLVariableFormulaEvaluable getVariableResource(javax.xml.namespace.QName variableName)

      Description copied from interface: `XBRLVariablesHolder`
      Access to the variable resource by its variable name.
      Specified by:
        `getVariableResource` in interface `XBRLVariablesHolder`
      Parameters:
        `variableName` - the q var
      Returns:
        XBRLVariableResource

    - #### getVariableValue

          public net.sf.saxon.s9api.XdmValue getVariableValue(javax.xml.namespace.QName variableName)
                                                       throws XFValidationException

      Description copied from interface: `XBRLVariablesHolder`
      Access to the variable value using the variable name. The returned value corresponds to the last evaluated value and is not evaluated again. It was evaluated prior to the formula expression evaluation
      Specified by:
        `getVariableValue` in interface `XBRLVariablesHolder`
      Parameters:
        `variableName` - javax.xml.namespace.QName
      Returns:
        XdmValue
      Throws:
        `XFValidationException` - the XF validation exception

    - #### getAssertionMessageVariables

          public java.util.Collection<? extends XBRLVariableResourceUse> getAssertionMessageVariables()

      Description copied from interface: `XBRLMessageContext`
      Gets the assertion message variables.
      Specified by:
        `getAssertionMessageVariables` in interface `XBRLMessageContext`
      Returns:
        the assertion message variables

    - #### collectAssertionVariablenames

          public void collectAssertionVariablenames(java.util.HashSet<javax.xml.namespace.QName> allVars)

      Description copied from interface: `XBRLMessageContext`
      Collect assertion variablenames.
      Specified by:
        `collectAssertionVariablenames` in interface `XBRLMessageContext`
      Parameters:
        `allVars` - the all vars

    - #### getAssertionContextItem

          public net.sf.saxon.s9api.XdmItem getAssertionContextItem()

      Description copied from interface: `XBRLMessageContext`
      Gets the assertion context item.
      Specified by:
        `getAssertionContextItem` in interface `XBRLMessageContext`
      Returns:
        the assertion context item

    - #### getUncoveredAspectValue

          public net.sf.saxon.s9api.XdmValue getUncoveredAspectValue(int aspect,
                                                            javax.xml.namespace.QName dimName)
                                                              throws XFValidationException

      Description copied from interface: `HasUncoveredAspectValueResolver`
      Used only for the implementation of the xff.uncovered-aspect(aspect, dimName) XPath function
      Specified by:
        `getUncoveredAspectValue` in interface `HasUncoveredAspectValueResolver`
      Parameters:
        `aspect` - the aspect
        `dimName` - the dim name
      Returns:
        the uncovered aspect value
      Throws:
        `XFValidationException` - the XF validation exception

    - #### isImplicitFilter

          public boolean isImplicitFilter()

      Description copied from interface: `XBRLVariablesHolder`
      Returns true if the variable set shall require implicit filtering.
      Specified by:
        `isImplicitFilter` in interface `HasUncoveredAspectValueResolver`
      Specified by:
        `isImplicitFilter` in interface `XBRLVariablesHolder`
      Returns:
        true, if is implicit filter

    - #### evaluateAssertion

          public XBRLAssertionResult[] evaluateAssertion(XBRLInstance doc)
                                                  throws XFValidationException

      Description copied from interface: `EvaluableAssertion`
      Required for evaluating the assertion.
      Specified by:
        `evaluateAssertion` in interface `EvaluableAssertion`
      Parameters:
        `doc` - the doc
      Returns:
        the XBRL assertion result[]
      Throws:
        `XFValidationException` - the XF validation exception

    - #### getExpression

          public java.lang.String getExpression()

      Access to the xpath expression for this consistency assertion.
      Returns:
        String

    - #### getErrorIdentification

          public java.lang.String getErrorIdentification()

      Description copied from interface: `EvaluableAssertion`
      Returns an string that identifies the assertion when an error is produced.
      Specified by:
        `getErrorIdentification` in interface `EvaluableAssertion`
      Returns:
        the error identification

    - #### getResource

          public XBRLResource getResource()

      Description copied from interface: `EvaluableAssertion`
      Returns the XBRLResource that contains the definition of the assertion.
      Specified by:
        `getResource` in interface `EvaluableAssertion`
      Returns:
        the XBRL Resource

    - #### getXFIImplicitFilterOptimizer

          public XFIImplicitFilterOptimizer getXFIImplicitFilterOptimizer()

      Description copied from interface: `XBRLVariablesHolder`
      Returns or creates the instance of the fact variable optimizer when the fact variable is used with implicit filtering in a set with more than 2 variables.
      Specified by:
        `getXFIImplicitFilterOptimizer` in interface `XBRLVariablesHolder`
      Returns:
        instance of the XFIImplicitFilterOptimizer