com.ihr.xbrl.om.assertions
Class XBRLConsistencyAssertion

java.lang.Object
  extended by com.ihr.xbrl.om.XMLFragment
      extended by com.ihr.xbrl.om.exLinks.XLinkElement
          extended by com.ihr.xbrl.om.exLinks.XBRLPointerOfARelationship
              extended by com.ihr.xbrl.om.exLinks.XBRLResource
                  extended by com.ihr.xbrl.om.formula.XBRLFormulaResource
                      extended by com.ihr.xbrl.om.assertions.XBRLConsistencyAssertion
All Implemented Interfaces:
AssertionEvaluationLocal, EvaluableAssertion, HasAssertionId, XBRLRelationshipPoint, XBRLMessageContext, HasFormulaProcessor, HasUncoveredAspectValueResolver, StaticCheck, XBRLVariablesHolder, XBRLValidation, XBRLValueKey, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext

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

Author:
Ignacio

Nested Class Summary
static class XBRLConsistencyAssertion.ConsistencyAssertionType
          Indicates the type of the Consistency Assertion.
static class XBRLConsistencyAssertion.XFConsistencyAssertionInvalidFact
           
 
Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation
XBRLValidation.Direction
 
Field Summary
static javax.xml.namespace.QName 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
           
static javax.xml.namespace.QName resourceName
           
static javax.xml.namespace.QName 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, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, idQName, NO_POSITION, OrderComparator, 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
XBRLConsistencyAssertion(XBRLFormulaProcessor proc, XBRLExtendedLink parent, net.sf.saxon.s9api.XdmNode resNode)
           
XBRLConsistencyAssertion(XBRLFormulaProcessor proc, XBRLResource other)
           
 
Method Summary
 void collectAssertionVariablenames(java.util.HashSet<javax.xml.namespace.QName> allVars)
           
 XBRLAssertionResult[] evaluateAssertion(XBRLInstance doc)
          Required for evaluating the assertion.
 XBRLAssertionResult[] evaluateAssertionType(XBRLInstance instance)
           
 java.lang.String getAbsoluteAcceptanceRadius()
           
 int getAspectModel()
          Returns either XBRLVariablesHolder.MODEL_DIMENSIONAL or XBRLVariablesHolder.MODEL_NON_DIMENSIONAL
 net.sf.saxon.s9api.XdmItem getAssertionContextItem()
           
 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()
           
 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()
           
 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()
           
 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.
 boolean isImplicitFilter()
          xff.uncovered-aspect(aspect, dimName) XPath function must raise an error if the formula is not implicit filtering
 boolean isStrict()
           
 void setAbsoluteAcceptanceRadius(java.lang.String expression)
           
 void setProportionalAcceptanceRadius(java.lang.String expression)
           
 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, 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, getAttribute, getAttributeQNameValue, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getId, getLang, getNamespaceURI, getNodeName, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getStringValue, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolveHRef, resolveHRef, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setValue, setVariablesDefined, 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

proportionalAcceptanceRadiusQName

public static final javax.xml.namespace.QName proportionalAcceptanceRadiusQName

absoluteAcceptanceRadiusQName

public static final javax.xml.namespace.QName absoluteAcceptanceRadiusQName

strict

public static final javax.xml.namespace.QName 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
Parameters:
proc -
parent -
resNode -
Throws:
XFValidationException

XBRLConsistencyAssertion

public XBRLConsistencyAssertion(XBRLFormulaProcessor proc,
                                XBRLResource other)
                         throws XFValidationException
Parameters:
proc -
other -
Throws:
XFValidationException
Method Detail

setProportionalAcceptanceRadius

public void setProportionalAcceptanceRadius(java.lang.String expression)
Parameters:
expression -

getProportionalAcceptanceRadius

public java.lang.String getProportionalAcceptanceRadius()
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()
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)
Parameters:
expression -

getConsistencyAssertionType

public XBRLConsistencyAssertion.ConsistencyAssertionType getConsistencyAssertionType()
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
Specified by:
evaluateAssertionType in interface AssertionEvaluationLocal
Throws:
XFValidationException

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()

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:

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:

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 -
Returns:
instance of XBRLVariableResourceUse or null if none exist
Throws:
XFRuntimeException - encapsulating a XFValidationException produced if this is the first time this function is called for the variable set and variables are read from the linkbase

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

getAssertionMessageVariables

public java.util.Collection<? extends XBRLVariableResourceUse> getAssertionMessageVariables()
Specified by:
getAssertionMessageVariables in interface XBRLMessageContext
Returns:

collectAssertionVariablenames

public void collectAssertionVariablenames(java.util.HashSet<javax.xml.namespace.QName> allVars)
Specified by:
collectAssertionVariablenames in interface XBRLMessageContext

getAssertionContextItem

public net.sf.saxon.s9api.XdmItem getAssertionContextItem()
Specified by:
getAssertionContextItem in interface XBRLMessageContext
Returns:

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
Returns:
Throws:
XFValidationException

isImplicitFilter

public boolean isImplicitFilter()
Description copied from interface: HasUncoveredAspectValueResolver
xff.uncovered-aspect(aspect, dimName) XPath function must raise an error if the formula is not implicit filtering

Specified by:
isImplicitFilter in interface HasUncoveredAspectValueResolver
Returns:

evaluateAssertion

public XBRLAssertionResult[] evaluateAssertion(XBRLInstance doc)
                                        throws XFValidationException
Description copied from interface: EvaluableAssertion
Required for evaluating the assertion.

Specified by:
evaluateAssertion in interface EvaluableAssertion
Returns:
Throws:
XFValidationException

getExpression

public java.lang.String getExpression()
Access to the xpath expression for this consistency assertion

Returns:
String


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa