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.
|
java.util.Collection<? extends java.lang.Object> |
getAspectDistinctValuesFromDTS()
When the
isDTSDependantOnly() returns true, this method
shall return the collection of objects that are evaluated as
filter output . |
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.
|
XBRLFormulaProcessor |
getProcessor()
Convenient method to access the surrounding instance of the
XBRLFormulaProcessor.
|
java.util.Set<Aspect> |
getRelatedAspect()
Returns a set of aspects the filter handles.
|
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.
|
boolean |
isDTSDependantOnly()
Normally filter XPath expressions produce different results
depending on the income instance document but there are some
special cases where a filter XPath expression depends only
on the content of the DTS.
|
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 reasonjava.util.Set<Aspect> getRelatedAspect()
void 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()
boolean isDTSDependantOnly()
java.util.Collection<? extends java.lang.Object> getAspectDistinctValuesFromDTS()
isDTSDependantOnly()
returns true, this method
shall return the collection of objects that are evaluated as
filter output .XBRLFormulaProcessor getProcessor()
Copyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa