public class XBRLFormulaProcessor extends java.lang.Object implements XBRLCompilableProcessor
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
assertion_satisfied_message_URI
http://xbrl.org/arcrole/2010/assertion-satisfied-message
|
static java.lang.String |
assertion_set_arcrole_URI
http://xbrl.org/arcrole/2008/assertion-set
|
static java.lang.String |
assertion_unsatisfied_message_URI
http://xbrl.org/arcrole/2010/assertion-unsatisfied-message
|
static java.lang.String |
boolean_filter_arcrole_URI
http://xbrl.org/arcrole/2008/boolean-filter
|
static java.lang.String |
consistency_assertion_formula_URI
http://xbrl.org/arcrole/2008/consistency-assertion-formula
|
static java.lang.String |
consistency_assertion_parameter_URI
http://xbrl.org/arcrole/2008/consistency-assertion-parameter
|
static java.lang.String |
equality_definition_arcrole_URI
http://xbrl.org/arcrole/2008/equality-definition
|
static java.lang.String |
function_implementation_URI
http://xbrl.org/arcrole/2010/function-implementation
|
static java.lang.String |
PROCESSORNAME
The Constant PROCESSORNAME.
|
static javax.xml.namespace.QName |
qError
The q error.
|
static java.lang.String |
variable_filter_arcrole_URI
http://xbrl.org/arcrole/2008/variable-filter
|
static java.lang.String |
variable_set_arcrole_URI
http://xbrl.org/arcrole/2008/variable-set
|
static java.lang.String |
variable_set_filter_arcrole_URI
http://xbrl.org/arcrole/2008/variable-set-filter
|
static java.lang.String |
variable_set_precondition_arcrole_URI
http://xbrl.org/arcrole/2008/variable-set-precondition
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAssertion(XBRLAssertion assertion)
Adds the assertion.
|
void |
addConsistencyAssertion(XBRLConsistencyAssertion consistencyAssertion)
Adds the consistency assertion.
|
void |
addCustomFunctionDeclaration(XBRLCustomFunction customFunction)
Adds the custom function declaration.
|
void |
addCustomFunctionLibrary(XBRLRSCustomFunctionLibrary fl)
Adds a Function Library to the set of function libraries available to the processor.
|
void |
addCustomLibraries(net.sf.saxon.sxpath.IndependentContext ic)
Adds the custom libraries.
|
void |
addFormula(XBRLFormula formula)
Adds the formula.
|
void |
addInScopeInstance(XBRLInstance doc)
Adds the in scope instance.
|
void |
addRSLibrary(net.sf.saxon.sxpath.IndependentContext ic)
Adds the rs library.
|
void |
addVariableParameter(XBRLVariableParameter variableParameter)
Adds the variable parameter.
|
void |
addXFFLibrary(net.sf.saxon.expr.StaticContext sc)
Adds the xff library.
|
void |
addXFILibrary(net.sf.saxon.expr.StaticContext sc)
Adds the xfi library.
|
static java.lang.String |
cleanFormulaExpression(java.lang.String expression)
Helper function that cleans up the content of an XPath expression so it can
be used as a text string in a GUI.
|
void |
clear()
Called when the DTSContainer's clear method is called.
|
void |
collectVariables(java.util.Collection<javax.xml.namespace.QName> hsVars)
Add parameter variables to the collection received as a parameter
This method can add only global variables available to all formulas.
|
static net.sf.saxon.s9api.XPathExecutable |
compileExpressionAndCollectRequiredVariables(java.lang.String selectExpression,
java.util.Collection<javax.xml.namespace.QName> requiredVariables,
java.util.Collection<net.sf.saxon.s9api.QName> preDefinedVariables,
net.sf.saxon.om.NamespaceResolver nsResolver,
XBRLFormulaResource fragment)
Compile expression and collect required variables.
|
XBRLValidationReport |
compileResources()
Compile resources.
|
void |
configure(java.util.Properties properties)
Configures the processor according with the properties passed in in the
properties parameter.
|
static XBRLFormulaProcessor |
create(DTSContainer dts)
Creates the.
|
static void |
declareNamespaces(XBRLResource resource,
net.sf.saxon.s9api.XPathCompiler compiler)
Helper method to declare all namespaces in the resource indicated as a parameter in the XPath
compiler received as a parameter.
|
XBRLValidationReport |
evaluate(XBRLResource resource,
XBRLInstance instance)
Evaluates one resource and returns an XBRLValidationReport instance.
|
void |
evaluateFormulaSet(java.util.Collection<XBRLFormula> formulas,
XBRLValidationReport valReport,
XBRLInstance doc,
ExecutionTargetType targetType)
Evaluates a collection of formulas and put the result inside the validation report passed in
as parameter valReport.
|
void |
freeUnnecessary()
Removes all resources and allows to call compileResources() again
This method is called in the last step of the DTS loading process
and specially when load is called multiple times.
|
AspectsCache |
getAspectsCache()
The aspects cache is used internally by the processor in order to accelerate
implicit filtering.
|
java.util.Collection<XBRLAssertion> |
getAssertions()
Access to all value assertions and existence assertions defined in the DTS and loaded
from the linkbases.
|
XBRLArcroleType |
getAssertionSatisfiedMessageArcroleType()
Gets the assertion satisfied message arcrole type.
|
XBRLArcroleType |
getAssertionUnsatisfiedMessageArcroleType()
Gets the assertion unsatisfied message arcrole type.
|
XBRLArcroleType |
getAssetionSetArcroleType()
Gets the assetion set arcrole type.
|
XBRLArcroleType |
getBooleanFilterArcroleType()
Gets the boolean filter arcrole type.
|
XBRLFact |
getCacheFact(net.sf.saxon.s9api.XdmNode factNode)
Search for a fact using the fact node.
|
XBRLArcroleType |
getConsistencyAssertionFormulaArcroleType()
Gets the consistency assertion formula arcrole type.
|
XBRLArcroleType |
getConsistencyAssertionParameterArcroleType()
Gets the consistency assertion parameter arcrole type.
|
java.util.Collection<XBRLConsistencyAssertion> |
getConsistencyAssertions()
Access to all consistency assertions defined in the DTS and loaded
from the linkbases.
|
DTSContainer |
getContainer()
Gets the container.
|
XBRLContext |
getContextById(java.lang.String id,
java.net.URI documentURI)
Gets the context by id.
|
XBRLCustomFunctionsLibraryList |
getCustomFunctionsLibraryList()
Access to the library list that contains custom function implementations.
|
java.lang.String |
getDescription()
Returns the processor description so it can be written in validation reports.
|
static java.lang.String |
getDescriptionStatic()
Gets the description static.
|
XMLFragment |
getElementById(java.lang.String id,
java.net.URI documentURI)
Gets the element by id.
|
XBRLArcroleType |
getEqualityDefinitionArcroleType()
Gets the equality definition arcrole type.
|
FactHasExplicitDimensionValueCache |
getFactHasExplicitDimensionValueCache()
Gets the fact has explicit dimension value cache.
|
FilterMemberCache |
getFilterMemberCache()
Gets the filter member cache.
|
XBRLFilterOrderTool |
getFilterOrderInstance()
The formula specification is not defining the order in which filters shall be
arranged to create the XPath evaluation expression.
|
java.util.Collection<XBRLFormula> |
getFormulas()
Access to all formula resources loaded from the linkbases and compiled as XBRLFormula
instances.
|
net.sf.saxon.s9api.XPathCompiler |
getFPXPathCompiler(net.sf.saxon.om.NamespaceResolver namespaceResolver,
XMLFragment fragment,
boolean schemaAware)
Always return a new XPathCompiler object with the IndependentContext
namespace Resolver set to the namespaceResolver supplied as a parameter.
|
XBRLArcroleType |
getFunctionImplementarionArcroleType()
Gets the function implementarion arcrole type.
|
java.lang.String |
getName()
Returns the processor name so it can be written in validation reports.
|
XBRLVariableResourceUse |
getParameterForBinding(javax.xml.namespace.QName var)
Access to the XBRLVariableParameter using the parameter name (which
is also the variable name on XPath expressions).
|
XBRLFormulaParametersResolver |
getParameterResolver()
Gets the parameter resolver.
|
java.util.Vector<XBRLVariableResourceUse> |
getParametersForBinding()
Creates a new Vector of XBRLVariableResourceUse and returns it to the calling application.
|
FormulaProcessorStatus |
getStatus()
Normally called from another thread, this method returns an instance of a FormulaProcessorStatus
class that provides information about the number of formulas, number of assertions, number
of consistency assertions. number of running threads, maximum time of a thread and what every
thread is doing.
|
XBRLFormula |
getUnderEvaluationFormula()
This method returns the formula that is being evaluated.
|
XBRLInstance |
getUnderEvaluationInstance()
Gets the under evaluation instance.
|
java.lang.String |
getUnderEvaluationResourceId()
This method returns the formula or assertion resource id that is being evaluated.
|
HasUncoveredAspectValueResolver |
getUnderEvaluationUncoveredAspectValue()
Access to the value of the instance of the class that will resolve
values for the xff:uncovered-aspect function.
|
javax.xml.namespace.QName |
getUnderEvaluationVariableName()
During the evaluation of an XPath expression in order to set the value of a variable name,
the variable name of the variable that is being evaluated can be obtained by a call to this
method.
|
XBRLUnit |
getUnitById(java.lang.String id,
java.net.URI documentURI)
Gets the unit by id.
|
XBRLValidationReport |
getValidationReport()
Access to the validation report that is active during formula validation.
|
XBRLArcroleType |
getVariableFilterArcroleType()
Gets the variable filter arcrole type.
|
XBRLArcroleType |
getVariableSetArcroleType()
Gets the variable set arcrole type.
|
XBRLArcroleType |
getVariableSetFilterArcroleType()
Gets the variable set filter arcrole type.
|
XBRLArcroleType |
getVariableSetPreconditionArcroleType()
Gets the variable set precondition arcrole type.
|
void |
informEnd(AssertionExecutor ae,
long elapsedTime)
Called from other threads once execution ends.
|
void |
informRunning(AssertionExecutor ae)
Called from the thread running the XBRLFormulaProcessor instance.
|
boolean |
isHidden()
A hidden processor will not pop-up in the GUI tabs.
|
boolean |
isStrictXPath()
Convenient method to obtain the value of the DTSContainer.FORMULA_PROCESSOR_USE_STRICT_SPECIFICATION_XPATH
property
|
boolean |
matcheable(XBRLFact fact1,
XBRLFact fact2,
int aspectModel,
XMLFragment context)
Computes if two facts are aspect-matched input facts as defined in the Formula specification.
|
void |
removeFormula(XBRLFormula xbrlFormula)
Marks a formula to be removed from the formula
list.
|
void |
removeInScopeInstance(XBRLInstance doc)
Removes the in scope instance.
|
void |
setParametersResolver(XBRLFormulaParametersResolver pResolver)
Sets the external parameters resolver to the instance of the class
indicated by the parameter.
|
void |
setUnderEvaluationInstance(XBRLInstance valInstance)
Sets or clear the instance document that is in the scope of formula functions.
|
void |
setUnderEvaluationResourceId(java.lang.String id)
This method sets the value of the formula or assertion identifier that is being evaluated.
|
void |
setUnderEvaluationUncoveredAspectValue(HasUncoveredAspectValueResolver resolver)
Sets the value for the resolver of the xff:uncovered-aspect function.
|
void |
setUnderEvaluationVariable(javax.xml.namespace.QName variableName)
Sets the under evaluation variable.
|
XBRLValidationReport |
validate()
Validates the content of the DTS according to the rules indicated in
this plug-in processor.
|
XBRLValidationReport |
validate(XBRLDocument doc)
Validates the document according to the rules indicated in
this plug-in processor.
|
XBRLValidationReport |
validate(XBRLInstance doc)
This method validates an instance document (doc) against the content of the formula
linkbase.
|
public static javax.xml.namespace.QName qError
public static final java.lang.String PROCESSORNAME
public static final java.lang.String variable_set_arcrole_URI
public static final java.lang.String variable_filter_arcrole_URI
public static final java.lang.String variable_set_filter_arcrole_URI
public static final java.lang.String variable_set_precondition_arcrole_URI
public static final java.lang.String equality_definition_arcrole_URI
public static final java.lang.String consistency_assertion_formula_URI
public static final java.lang.String consistency_assertion_parameter_URI
public static final java.lang.String assertion_satisfied_message_URI
public static final java.lang.String assertion_unsatisfied_message_URI
public static final java.lang.String boolean_filter_arcrole_URI
public static final java.lang.String assertion_set_arcrole_URI
public static final java.lang.String function_implementation_URI
public void configure(java.util.Properties properties)
XBRLPlugInProcessorconfigure in interface XBRLPlugInProcessorproperties - the propertiespublic void addXFILibrary(net.sf.saxon.expr.StaticContext sc)
sc - the scpublic void addXFFLibrary(net.sf.saxon.expr.StaticContext sc)
sc - the scpublic void addCustomLibraries(net.sf.saxon.sxpath.IndependentContext ic)
ic - the icpublic void addRSLibrary(net.sf.saxon.sxpath.IndependentContext ic)
ic - the icpublic static XBRLFormulaProcessor create(DTSContainer dts) throws com.rs.lic.LicenseVerificationException, XBRLValidationException
dts - the dtscom.rs.lic.LicenseVerificationException - the license verification exceptionXBRLValidationException - the XBRL validation exceptionpublic XBRLArcroleType getVariableSetArcroleType()
public XBRLArcroleType getVariableFilterArcroleType()
public XBRLArcroleType getVariableSetFilterArcroleType()
public XBRLArcroleType getVariableSetPreconditionArcroleType()
public XBRLArcroleType getEqualityDefinitionArcroleType()
public XBRLArcroleType getConsistencyAssertionParameterArcroleType()
public XBRLArcroleType getConsistencyAssertionFormulaArcroleType()
public XBRLArcroleType getFunctionImplementarionArcroleType()
public XBRLArcroleType getAssertionSatisfiedMessageArcroleType()
public XBRLArcroleType getAssertionUnsatisfiedMessageArcroleType()
public XBRLArcroleType getBooleanFilterArcroleType()
public XBRLArcroleType getAssetionSetArcroleType()
public XBRLValidationReport validate()
XBRLPlugInProcessorThis is the method that is called by the DTSContainer on each XBRLPlugInProcessor when the validation() method is called on the DTSContainer instance.
validate in interface XBRLPlugInProcessorXBRLValidationReportpublic XBRLValidationReport validate(XBRLDocument doc)
XBRLPlugInProcessorvalidate in interface XBRLPlugInProcessordoc - the x documentXBRLValidationReportpublic XBRLValidationReport validate(XBRLInstance doc)
doc - input instance documentpublic XBRLCustomFunctionsLibraryList getCustomFunctionsLibraryList()
public AspectsCache getAspectsCache()
For internal use only.
public FilterMemberCache getFilterMemberCache()
public FactHasExplicitDimensionValueCache getFactHasExplicitDimensionValueCache()
public boolean isStrictXPath()
public void informRunning(AssertionExecutor ae)
ae - the aepublic void informEnd(AssertionExecutor ae, long elapsedTime)
ae - the aeelapsedTime - the elapsed timepublic void removeInScopeInstance(XBRLInstance doc)
doc - the docpublic void addInScopeInstance(XBRLInstance doc)
doc - the docpublic void setUnderEvaluationResourceId(java.lang.String id)
id - the assertion or formula id or null to unset the value after
execution is finishedgetUnderEvaluationResourceId()public java.lang.String getUnderEvaluationResourceId()
public XBRLFormula getUnderEvaluationFormula()
public void evaluateFormulaSet(java.util.Collection<XBRLFormula> formulas, XBRLValidationReport valReport, XBRLInstance doc, ExecutionTargetType targetType)
This method is called from the processor in order to evaluate the formula set and from assertions that contains dependant formulas before the assertion is evaluated.
formulas - the collection of formulas to evaluatevalReport - the validation report where the results will be placed. The returned instance document will he here too.doc - the contextual information for the formulas to evaluate.targetType - the target typepublic XBRLValidationReport getValidationReport()
This method is used internally by the API in order to add warning messages generated by the evaluation of filters and other areas of the formula processor.
public DTSContainer getContainer()
public XBRLValidationReport compileResources()
compileResources in interface XBRLCompilableProcessorpublic java.util.Collection<XBRLFormula> getFormulas()
public java.util.Collection<XBRLAssertion> getAssertions()
public java.util.Collection<XBRLConsistencyAssertion> getConsistencyAssertions()
public void addVariableParameter(XBRLVariableParameter variableParameter) throws XFxbrlveParameterNameClash
variableParameter - the variable parameterXFxbrlveParameterNameClash - the x fxbrlve parameter name clashpublic void addCustomFunctionLibrary(XBRLRSCustomFunctionLibrary fl)
fl - the new FunctionLibrary instancepublic void addFormula(XBRLFormula formula)
formula - the formulapublic static void declareNamespaces(XBRLResource resource, net.sf.saxon.s9api.XPathCompiler compiler)
resource - the source element where the namespaces are declaredcompiler - the target XPath compiler where namespaces will be copied topublic XBRLInstance getUnderEvaluationInstance()
public void setUnderEvaluationInstance(XBRLInstance valInstance)
valInstance - the new under evaluation instancepublic net.sf.saxon.s9api.XPathCompiler getFPXPathCompiler(net.sf.saxon.om.NamespaceResolver namespaceResolver,
XMLFragment fragment,
boolean schemaAware)
namespaceResolver - the namespace resolverfragment - XMLFragment used to obtain the Base URI for the XPathCompilerschemaAware - if true, the new XPathCompiler will be Schema Aware. All schemas currently loaded will be in the scope schemas for XPath compilation. It is safe to always put 'true' here.public void collectVariables(java.util.Collection<javax.xml.namespace.QName> hsVars)
hsVars - the hs varspublic java.util.Vector<XBRLVariableResourceUse> getParametersForBinding()
When a parameter is found during the compilation phase it is stored in the XBRLFormulaProcessor instance as an instance of a XBRLVariableParameter. When this function is called, a new Vector of XBRLVariableResourceUse is created so the parameter can be evaluated by multiple threads in parallel.
The class XBRLVariableParameter contains information about the parameter that can be shared across threads. the class XBRLVariableResourceUse is associated with the running thread.
public XBRLVariableResourceUse getParameterForBinding(javax.xml.namespace.QName var)
var - the variable or parameter namepublic void setParametersResolver(XBRLFormulaParametersResolver pResolver)
pResolver - the new parameters resolverpublic XBRLFormulaParametersResolver getParameterResolver()
public void removeFormula(XBRLFormula xbrlFormula)
The function does nothing if the formula is already removed.
xbrlFormula - the xbrl formulapublic java.lang.String getDescription()
XBRLPlugInProcessorgetDescription in interface XBRLPlugInProcessorpublic java.lang.String getName()
XBRLPlugInProcessorgetName in interface XBRLPlugInProcessorpublic static java.lang.String getDescriptionStatic()
public void addAssertion(XBRLAssertion assertion)
assertion - the assertionpublic void addCustomFunctionDeclaration(XBRLCustomFunction customFunction)
customFunction - the custom functionpublic void addConsistencyAssertion(XBRLConsistencyAssertion consistencyAssertion)
consistencyAssertion - the consistency assertionpublic boolean matcheable(XBRLFact fact1, XBRLFact fact2, int aspectModel, XMLFragment context)
fact1 - the fact1fact2 - the fact2aspectModel - the aspect modelcontext - the contextpublic XBRLFact getCacheFact(net.sf.saxon.s9api.XdmNode factNode)
factNode - the fact nodepublic XBRLUnit getUnitById(java.lang.String id, java.net.URI documentURI)
id - the iddocumentURI - the document uripublic XMLFragment getElementById(java.lang.String id, java.net.URI documentURI)
id - the iddocumentURI - the document uripublic XBRLContext getContextById(java.lang.String id, java.net.URI documentURI)
id - the iddocumentURI - the document uripublic static net.sf.saxon.s9api.XPathExecutable compileExpressionAndCollectRequiredVariables(java.lang.String selectExpression,
java.util.Collection<javax.xml.namespace.QName> requiredVariables,
java.util.Collection<net.sf.saxon.s9api.QName> preDefinedVariables,
net.sf.saxon.om.NamespaceResolver nsResolver,
XBRLFormulaResource fragment)
throws XFValidationException
selectExpression - the select expressionrequiredVariables - (OUT) the required variables. from the preDefinedVariables.preDefinedVariables - (IN) the complete set of variables available. Only variables required by the expression will be moved from
here to the requiredVariables parameter.nsResolver - the ns resolverfragment - instance of XBRLFormulaResourceXFValidationException - the XF validation exceptionpublic FormulaProcessorStatus getStatus()
public void setUnderEvaluationVariable(javax.xml.namespace.QName variableName)
variableName - the new under evaluation variablepublic javax.xml.namespace.QName getUnderEvaluationVariableName()
The method will return null if there are no variable being evaluated. extension functions may access this method in order to access to the variable resource use and examine filters as is the case of the relative filter.
public void setUnderEvaluationUncoveredAspectValue(HasUncoveredAspectValueResolver resolver)
resolver - the new under evaluation uncovered aspect valuepublic HasUncoveredAspectValueResolver getUnderEvaluationUncoveredAspectValue()
public XBRLValidationReport evaluate(XBRLResource resource, XBRLInstance instance)
This method is used by the GUI of the FormulaTT class.
resource - the resourceinstance - the instancepublic static java.lang.String cleanFormulaExpression(java.lang.String expression)
The method trims the expression and then replaces cr by spaces.
expression - string XPath expressionpublic XBRLFilterOrderTool getFilterOrderInstance()
Starting with version 2.8.1 it is possible to define other classes implementing the XBRLFilterOrderTool interface by providing the class name in the http://www.reportingstandard.com/FormulaProcessor/FilterOrderClass property. For convenience, that property is defined in the DTSContainer.FORMULA_PROCESSOR_FILTER_ORDER_CLASS constant.
public void freeUnnecessary()
throws com.rs.lic.LicenseVerificationException,
XBRLValidationException
freeUnnecessary in interface XBRLCompilableProcessorcom.rs.lic.LicenseVerificationException - the license verification exceptionXBRLValidationException - the XBRL validation exceptionpublic void clear()
XBRLPlugInProcessorclear in interface XBRLPlugInProcessorpublic boolean isHidden()
XBRLPlugInProcessorisHidden in interface XBRLPlugInProcessor