public interface XBRLFormulaFilter
A filter can be compared against other filters in order to decide about the order the filter expressions are evaluated. This order is not defined in the XBRL Formula Specification (a mistake made by the authors of the Specification) but filter order is relevant during the formula evaluation. Example
Expression A obtains facts in the instance
Expression B returns the unit of a monetary fact variable.
Expression B would return an error condition if the fact is not numeric.
Expression C filters only numeric values from the instance.
Expression C should be evaluated BEFORE expression B in order to avoid unexpected errors to be raised during the evaluation of expression B.
The Formula Specification 1.0 does not allows users to define any order in which the filters should be evaluated. So different implementations would raise different results.
In the opinion of RS, the XBRL Formula specification should allow just one filter (the general filter) and avoid any other filter to exist. Software products in the market would facilitate users to write the long XPath expressions, the specification is NOT the place to put all this stuff.
| Modifier and Type | Method and Description |
|---|---|
void |
collectVariables(java.util.Collection<javax.xml.namespace.QName> col,
java.util.Collection<net.sf.saxon.s9api.QName> resolved)
This method is called after the filter has been compiled.
|
int |
getFilterWeight()
Returns a number assigned statically to every filter type in order
to facilitate evaluate the right order in which filters should be
concatenated in an XPath expression or Boolean Filter.
|
java.lang.String |
getLabel()
Implemented in the XBRLResource.
|
int |
getRelatedAspect(boolean bIsCover)
Returns a constant value indicating the aspect covered by this filter
Constants are defined in the CommonAspectRule class.
|
java.lang.String |
getXPathTerm(java.util.Collection<net.sf.saxon.s9api.QName> preDefinedVariables)
Access to the XPath expression for this filter according to the
formula specification.
|
java.lang.String getXPathTerm(java.util.Collection<net.sf.saxon.s9api.QName> preDefinedVariables)
throws XFValidationException
preDefinedVariables - set of pre defined variables in the variable setXFValidationException - if the variable filter XPath expression cannot be compiled for any reasonint getRelatedAspect(boolean bIsCover)
bIsCover - boolean value indicating the value of the cover attribute on the arc
connecting the variable with the filtervoid collectVariables(java.util.Collection<javax.xml.namespace.QName> col,
java.util.Collection<net.sf.saxon.s9api.QName> resolved)
col - the collection where variables will be appendedresolved - the resolvedint getFilterWeight()
A typical implementation should just do:
XBRLFilterOrderTool.getFilterWeight(getClass());and make sure the class is defined in the XBRLFilterOrderTool
java.lang.String getLabel()