public class XBRLVariableResourceUse
extends java.lang.Object
A variable use can be shared between multiple variable sets. But it MUST not be shared between different threads evaluating the same variable name. Each thread must have its own local copy of the evaluation values.
Constructor and Description |
---|
XBRLVariableResourceUse(javax.xml.namespace.QName name,
XBRLVariableFormulaEvaluable res,
XBRLVariablesHolder set)
Instantiates a new XBRL variable resource use.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkVariable(java.util.Collection<net.sf.saxon.s9api.QName> resolved)
Execute validations as defined in the Formula specification.
|
void |
clear()
Clear.
|
int |
evaluatedValueSize()
Access to the number of elements in the evaluation sequence.
|
net.sf.saxon.s9api.XdmValue |
evaluateValue(XMLFragment evaluationContext,
java.util.Collection<XBRLVariableResourceUse> evaluatedVars,
boolean bResetAtEnd,
VariablesLoopController.InterfaceVariableSetIterator nestedIterator)
Evaluates this variable value.
|
XFValidationException |
getEvaluationError()
Gets the evaluation error.
|
EvaluationType |
getEvaluationType()
Computes the evaluation type for the value that
|
net.sf.saxon.s9api.XdmValue |
getLastEvaluatedValue(XMLFragment evaluationContext,
java.util.Collection<XBRLVariableResourceUse> availableVars)
Returns the last evaluated value for this variable from the cached value.
|
javax.xml.namespace.QName |
getVariableName()
Access to the variable name (a QName).
|
XBRLVariableFormulaEvaluable |
getVariableResource()
This is the XBRLVariableResource this variable use is assigned to.
|
net.sf.saxon.s9api.QName |
getVariableS9APIQName()
Helper method to obtain the variable name using a saxon s9api QName
rather than a java.xml.namespace.QName
|
java.util.Collection<javax.xml.namespace.QName> |
getVariablesRequired()
Access to a collection of variable names required to evaluate this variable.
|
boolean |
hasNext()
Returns true if this variable has been evaluated and there are more values not already obtained
using calls to evaluateValue.
|
boolean |
hasNextExcludingFallback()
Returns true when this method has a next value that will not be the fallback value.
|
boolean |
isEvaluated()
Returns true if this variable has been successfully evaluated the last time it was evaluated.
|
boolean |
isFallbackDefined()
If the variable has a fall back value defined this method will return true. regardless the last evaluation
is the fall back value or not.
|
boolean |
isFallBackEvaluation()
Returns true if the last evaluated value is the fallback value.
|
boolean |
isNextFallback()
Checks if is next fallback.
|
java.util.List<java.util.List<net.sf.saxon.om.NodeInfo>> |
preparePartitions(java.util.List<java.util.List<net.sf.saxon.om.NodeInfo>> hsOutSeq,
java.util.Set<Aspect> coveredAspects)
For API use only.
|
void |
recycle()
This method sets the internal iterator to the first element and avoids
evaluating the XPath expression again.
|
void |
replaceLastEvaluatedValue(net.sf.saxon.s9api.XdmValue newValue)
Sets the cache of the evaluated value to a specific value.
|
void |
reset()
Sets this variable use to the status of not evaluated.
|
void |
setIsEvaluated(boolean value)
Sets the cache of the evaluated flag value to a specific value.
|
void |
setLastEvaluatedLen(int i)
Sets the cache of the evaluated sequence length to a specific value.
|
void |
setLastIsFallback(boolean value)
Sets the cache of the evaluated to fall back value to a specific value.
|
void |
setVariableName(javax.xml.namespace.QName name)
Sets a specific variable name if needed.
|
long |
size()
Size.
|
java.lang.String |
toString()
To string.
|
public XBRLVariableResourceUse(javax.xml.namespace.QName name, XBRLVariableFormulaEvaluable res, XBRLVariablesHolder set)
name
- the nameres
- the resset
- the setpublic javax.xml.namespace.QName getVariableName()
public void setVariableName(javax.xml.namespace.QName name)
name
- QNamepublic XBRLVariableFormulaEvaluable getVariableResource()
public net.sf.saxon.s9api.QName getVariableS9APIQName()
public net.sf.saxon.s9api.XdmValue evaluateValue(XMLFragment evaluationContext, java.util.Collection<XBRLVariableResourceUse> evaluatedVars, boolean bResetAtEnd, VariablesLoopController.InterfaceVariableSetIterator nestedIterator) throws XFValidationException
If the variable does not binds as sequence but the variable evaluation returns a sequence this method returns the first (or next) element in the sequence
evaluationContext
- the evaluation contextevaluatedVars
- the evaluated varsbResetAtEnd
- the b reset at endnestedIterator
- used to check for more loops during calculation of hasNext on the next method, this is null for variables in consistency assertionsXFValidationException
- the XF validation exceptionpublic java.util.List<java.util.List<net.sf.saxon.om.NodeInfo>> preparePartitions(java.util.List<java.util.List<net.sf.saxon.om.NodeInfo>> hsOutSeq, java.util.Set<Aspect> coveredAspects) throws XFValidationException
hsOutSeq
- the hs out seqcoveredAspects
- the covered aspectsXFValidationException
- the XF validation exceptionpublic net.sf.saxon.s9api.XdmValue getLastEvaluatedValue(XMLFragment evaluationContext, java.util.Collection<XBRLVariableResourceUse> availableVars)
getEvaluationError()
to obtain the surrounding XFValidationExceptionevaluationContext
- the evaluation contextavailableVars
- the available varspublic XFValidationException getEvaluationError()
public int evaluatedValueSize()
public java.util.Collection<javax.xml.namespace.QName> getVariablesRequired()
This is static information once the variable and all its filters are compiled.
public boolean checkVariable(java.util.Collection<net.sf.saxon.s9api.QName> resolved) throws XFValidationException
resolved
- the resolvedXFValidationException
- the XF validation exceptionpublic void replaceLastEvaluatedValue(net.sf.saxon.s9api.XdmValue newValue)
newValue
- the new valuepublic boolean isEvaluated()
public EvaluationType getEvaluationType()
public void setLastEvaluatedLen(int i)
i
- the new last evaluated lenpublic void setLastIsFallback(boolean value)
value
- the new checks if is evaluatedpublic void setIsEvaluated(boolean value)
value
- the new checks if is evaluatedpublic void reset()
public void clear()
public boolean hasNext()
public boolean isFallbackDefined()
public boolean isFallBackEvaluation()
public boolean isNextFallback()
#evaluateValue(XMLFragment, Collection, boolean, InterfaceVariableSetIterator)
will return the fallback valuepublic long size()
public void recycle()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasNextExcludingFallback() throws XFValidationException
XFValidationException
- the XF validation exceptionCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa