com.ihr.xbrl.om.formula
Interface XBRLVariableFormulaEvaluable

All Known Implementing Classes:
XBRLVariableFact, XBRLVariableGeneral, XBRLVariableInternal, XBRLVariableParameter, XBRLVariableResource

public interface XBRLVariableFormulaEvaluable

Author:
Ignacio

Method Summary
 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.
 boolean checkVariable(XBRLVariablesHolder set, javax.xml.namespace.QName name, java.util.Collection<net.sf.saxon.s9api.QName> resolved)
          Called for variables that are also resources during the static compilation phase of the formula preparation.
 Evaluation evaluateValue(XMLFragment evaluationContext, java.util.Collection<XBRLVariableResourceUse> availableVars, XBRLVariableSetResource set)
          Evaluates the resource internal XPath expression and returns either the returned value from the XPath expression or the fall back value in the case of variables that may have a fall back value and the rawEvaluation of the XPath expression results in the empty sequence.
 java.util.List<XBRLFilterUse> getFilters(int aspect)
           
 XBRLFormulaProcessor getProcessor()
          Returns an instance of the XBRLFormulaProcessor this variable has been created under
 java.util.Collection<javax.xml.namespace.QName> getVariablesRequired(XBRLVariablesHolder set)
          Returns a collection of variables required for the evaluation of this variable
 XBRLVariableType getVariableType()
           
 boolean hasFilterAspect(int aspect, javax.xml.namespace.QName dimName)
           
 Evaluation rawEvaluateValue(XMLFragment evaluationContext, java.util.Collection<XBRLVariableResourceUse> availableVars)
          Evaluates the resource internal XPath expression and returns the sequence.
 

Method Detail

evaluateValue

Evaluation evaluateValue(XMLFragment evaluationContext,
                         java.util.Collection<XBRLVariableResourceUse> availableVars,
                         XBRLVariableSetResource set)
                         throws XFValidationException
Evaluates the resource internal XPath expression and returns either the returned value from the XPath expression or the fall back value in the case of variables that may have a fall back value and the rawEvaluation of the XPath expression results in the empty sequence. The raw evaluation of the XPath expression is implemented in the #rawEvaluateValue(XMLFragment, Collection, XBRLVariableSetResource) call.

Parameters:
evaluationContext -
availableVars -
Returns:
Throws:
XFValidationException

rawEvaluateValue

Evaluation rawEvaluateValue(XMLFragment evaluationContext,
                            java.util.Collection<XBRLVariableResourceUse> availableVars)
                            throws XFValidationException
Evaluates the resource internal XPath expression and returns the sequence. This method does not considers nor evaluates the default value if any is possible. The evaluation considering default values is implemented in the evaluateValue(XMLFragment, Collection, XBRLVariableSetResource) method.

Parameters:
evaluationContext -
availableVars -
Returns:
Throws:
XFValidationException

bindAsSequence

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

Returns:

checkVariable

boolean checkVariable(XBRLVariablesHolder set,
                      javax.xml.namespace.QName name,
                      java.util.Collection<net.sf.saxon.s9api.QName> resolved)
                      throws XFValidationException
Called for variables that are also resources during the static compilation phase of the formula preparation.

throws exceptions according to the validation rules.

shall return true on success

Parameters:
set -
name -
resolved -
Returns:
Throws:
XFValidationException

getVariablesRequired

java.util.Collection<javax.xml.namespace.QName> getVariablesRequired(XBRLVariablesHolder set)
Returns a collection of variables required for the evaluation of this variable

Parameters:
set -
Returns:
collection of QNames

getProcessor

XBRLFormulaProcessor getProcessor()
Returns an instance of the XBRLFormulaProcessor this variable has been created under

Returns:
XBRLFormulaProcessor

getFilters

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

hasFilterAspect

boolean hasFilterAspect(int aspect,
                        javax.xml.namespace.QName dimName)
Parameters:
aspect -
dimName - if aspect is DIMENSION then dimName is the dimension name
Returns:

getVariableType

XBRLVariableType getVariableType()
Returns:

adjustValueAccordingToType

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

Parameters:
item - the value that must be converted to the type indicated in the as attribute
val - value to be returned when no "as" attribute exist on variable
Returns:
XdmValue (atomic) or the value of the val parameter
Throws:
XFValidationException


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