com.ihr.xbrl.om.formula
Class XBRLVariableSetResource

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.formula.XBRLVariableSetResource
All Implemented Interfaces:
XBRLRelationshipPoint, HasFormulaProcessor, XBRLVariablesHolder, XBRLValueKey, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
Direct Known Subclasses:
XBRLAssertion, XBRLFormula

public abstract class XBRLVariableSetResource
extends XBRLFormulaResource
implements XBRLVariablesHolder

Author:
Ignacio

Field Summary
static javax.xml.namespace.QName aspectModel
           
static javax.xml.namespace.QName implicitFiltering
           
static org.apache.log4j.Logger log
           
 
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
XBRLVariableSetResource(XBRLFormulaProcessor proc, XBRLExtendedLink parent, net.sf.saxon.s9api.XdmNode resNode)
           
XBRLVariableSetResource(XBRLFormulaProcessor proc, XBRLResource other)
           
 
Method Summary
static java.util.Collection<? extends javax.xml.namespace.QName> allDimensions(XBRLFact xFact)
           
 boolean bindCycle(XPathHelper xph)
           
 void bindLastEvaluatedVariableValues(net.sf.saxon.s9api.XPathSelector xpathExpression, java.util.Collection<javax.xml.namespace.QName> requiredVariables)
          This method should be called when there is no need to advance to the next values in the sequence
 void bindParameters(net.sf.saxon.s9api.XPathSelector xpathExpression, java.util.Collection<javax.xml.namespace.QName> requiredVariables)
           
 void bindVariableValue(net.sf.saxon.s9api.QName varName, net.sf.saxon.s9api.XPathSelector sel)
           
 void checkCyclicDependencies(javax.xml.namespace.QName source)
          Starting variable to check cycles from
 void compileFilters()
           
 net.sf.saxon.s9api.XPathExecutable compileFormulaExpression(java.lang.String expression, boolean namespaces, boolean variables)
           
 java.util.Collection<javax.xml.namespace.QName> declareVariables(net.sf.saxon.s9api.XPathCompiler compiler, boolean bNamespaces, boolean bVariables, javax.xml.namespace.QName name)
           
 int getAspectModel()
          Returns either XBRLVariablesHolder.MODEL_DIMENSIONAL or XBRLVariablesHolder.MODEL_NON_DIMENSIONAL
 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
 java.util.Collection<XBRLFilterUse> getFilters()
          Returns a collection of XBRLFilterUse instance representing the use of filters associated to this XBRLVariablesHolder.
 int getNumberOfVariables()
           
 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.
 net.sf.saxon.s9api.XdmValue getVariableValue(javax.xml.namespace.QName variableName, int aspect, javax.xml.namespace.QName dimName)
          Access to the variable value using the variable name.
 boolean isCovered(javax.xml.namespace.QName source, int aspect)
          Returns true when the variable used in the source parameter is covered
 boolean isImplicitFilter()
          Returns the value of the implicitfiltering attribute for this variableSet
 
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, getValueKey, hashCode, isComplexType, isSimpleType, setComplexType, setDTSBase, setId, setParent, setRole, setRoleType, setSimpleType, setValue
 
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, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getDeclaredNamespaces, getDocument, getElements, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getId, getLang, getNamespaceURI, getNodeName, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getStringValue, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, 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.formula.HasFormulaProcessor
getProcessor
 
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

implicitFiltering

public static final javax.xml.namespace.QName implicitFiltering

aspectModel

public static final javax.xml.namespace.QName aspectModel
Constructor Detail

XBRLVariableSetResource

public XBRLVariableSetResource(XBRLFormulaProcessor proc,
                               XBRLExtendedLink parent,
                               net.sf.saxon.s9api.XdmNode resNode)
                        throws XFValidationException
Parameters:
parent -
resNode -
Throws:
XFValidationException

XBRLVariableSetResource

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

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

isImplicitFilter

public boolean isImplicitFilter()
Returns the value of the implicitfiltering attribute for this variableSet

Returns:
boolean

bindCycle

public boolean bindCycle(XPathHelper xph)
                  throws XFValidationException
Throws:
XFValidationException

allDimensions

public static java.util.Collection<? extends javax.xml.namespace.QName> allDimensions(XBRLFact xFact)
Parameters:
xFact1 -
Returns:

bindLastEvaluatedVariableValues

public void bindLastEvaluatedVariableValues(net.sf.saxon.s9api.XPathSelector xpathExpression,
                                            java.util.Collection<javax.xml.namespace.QName> requiredVariables)
This method should be called when there is no need to advance to the next values in the sequence

Parameters:
xpathExpression -
requiredVariables -
evalProvider -

bindParameters

public void bindParameters(net.sf.saxon.s9api.XPathSelector xpathExpression,
                           java.util.Collection<javax.xml.namespace.QName> requiredVariables)

declareVariables

public java.util.Collection<javax.xml.namespace.QName> declareVariables(net.sf.saxon.s9api.XPathCompiler compiler,
                                                                        boolean bNamespaces,
                                                                        boolean bVariables,
                                                                        javax.xml.namespace.QName name)
                                                                 throws XFValidationException
Throws:
XFValidationException

checkCyclicDependencies

public void checkCyclicDependencies(javax.xml.namespace.QName source)
                             throws XFValidationException
Starting variable to check cycles from

Parameters:
source - QName
Throws:
XFValidationException

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

getVariableValue

public net.sf.saxon.s9api.XdmValue getVariableValue(javax.xml.namespace.QName variableName,
                                                    int aspect,
                                                    javax.xml.namespace.QName dimName)
                                             throws XFValidationException
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.

This function is able to deal with the formula:uncovered variable name and obtains the SAV according to the specification.

Parameters:
variableName -
dimName - Optional, dimension name. Used only when aspect is DIMENSION
Returns:
XdmValue
Throws:
XFValidationException

compileFilters

public void compileFilters()
                    throws XFValidationException
Parameters:
xbrlFormula -
Throws:
XFValidationException

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:

compileFormulaExpression

public net.sf.saxon.s9api.XPathExecutable compileFormulaExpression(java.lang.String expression,
                                                                   boolean namespaces,
                                                                   boolean variables)
                                                            throws XFValidationException
Throws:
XFValidationException

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:

bindVariableValue

public void bindVariableValue(net.sf.saxon.s9api.QName varName,
                              net.sf.saxon.s9api.XPathSelector sel)
Parameters:
varName -
sel -

getNumberOfVariables

public int getNumberOfVariables()
Returns:

isCovered

public boolean isCovered(javax.xml.namespace.QName source,
                         int aspect)
Returns true when the variable used in the source parameter is covered

Parameters:
source -
aspect -
Returns:


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