|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ihr.xbrl.om.formula.XBRLFormulaProcessor
public class XBRLFormulaProcessor
| Field Summary | |
|---|---|
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 |
PROCESSORNAME
|
static javax.xml.namespace.QName |
qError
|
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 |
| Method Summary | |
|---|---|
void |
addAssertion(XBRLAssertion assertion)
|
void |
addConsistencyAssertion(XBRLConsistencyAssertion consistencyAssertion)
|
void |
addCustomFunctionDeclaration(XBRLCustomFunction customFunction)
|
void |
addCustomFunctionLibrary(XBRLRSCustomFunctionLibrary fl)
Adds a Function Library to the set of function libraries available to the processor. |
void |
addFormula(XBRLFormula formula)
|
void |
addInScopeInstance(XBRLInstance doc)
|
void |
addVariableParameter(XBRLVariableParameter variableParameter)
|
void |
addXFFLibrary(net.sf.saxon.expr.StaticContext sc)
|
void |
addXFILibrary(net.sf.saxon.expr.StaticContext sc)
|
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 |
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)
|
void |
compileResources()
|
void |
configure(java.util.Properties properties)
Configures the processor according with the properties passed in in the properties parameter |
static XBRLFormulaProcessor |
create(DTSContainer dts)
|
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. |
AspectsCache |
getAspectsCache()
The aspects cache is used internally by the processor in order to accelerate implicit filtering. |
XBRLArcroleType |
getAssertionSatisfiedMessageArcroleType()
|
XBRLArcroleType |
getAssertionUnsatisfiedMessageArcroleType()
|
XBRLArcroleType |
getAssetionSetArcroleType()
|
XBRLArcroleType |
getBooleanFilterArcroleType()
|
XBRLFact |
getCacheFact(net.sf.saxon.s9api.XdmNode factNode)
Search for a fact using the fact node. |
XBRLArcroleType |
getConsistencyAssertionFormulaArcroleType()
|
XBRLArcroleType |
getConsistencyAssertionParameterArcroleType()
|
DTSContainer |
getContainer()
|
XBRLContext |
getContextById(java.lang.String id,
java.net.URI documentURI)
|
java.lang.String |
getDescription()
Returns the processor description so it can be written in validation reports |
static java.lang.String |
getDescriptionStatic()
|
XMLFragment |
getElementById(java.lang.String id,
java.net.URI documentURI)
|
XBRLArcroleType |
getEqualityDefinitionArcroleType()
|
FilterMemberCache |
getFilterMemberCache()
|
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. |
java.lang.String |
getName()
Returns the processor name so it can be written in validation reports |
XBRLFormulaParametersResolver |
getParameterResolver()
|
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()
|
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)
|
XBRLValidationReport |
getValidationReport()
Access to the validation report that is active during formula validation. |
XBRLArcroleType |
getVariableFilterArcroleType()
|
XBRLArcroleType |
getVariableSetArcroleType()
|
XBRLArcroleType |
getVariableSetFilterArcroleType()
|
XBRLArcroleType |
getVariableSetPreconditionArcroleType()
|
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 |
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)
|
void |
setParametersResolver(XBRLFormulaParametersResolver pResolver)
Sets the external parameters resolver to the instance of the class indicated by the parameter |
void |
setUnderEvaluationFormula(XBRLFormula formula)
This method sets the value of the formula that is being evaluated. |
void |
setUnderEvaluationInstance(XBRLInstance valInstance)
Sets or clear the instance document that is in the scope of formula functions. |
void |
setUnderEvaluationUncoveredAspectValue(HasUncoveredAspectValueResolver resolver)
Sets the value for the resolver of the xff:uncovered-aspect function. |
void |
setUnderEvaluationVariable(javax.xml.namespace.QName variableName)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Method Detail |
|---|
public void configure(java.util.Properties properties)
XBRLPlugInProcessor
configure in interface XBRLPlugInProcessorpublic void addXFILibrary(net.sf.saxon.expr.StaticContext sc)
public void addXFFLibrary(net.sf.saxon.expr.StaticContext sc)
public static XBRLFormulaProcessor create(DTSContainer dts)
throws com.rs.lic.LicenseVerificationException,
XBRLValidationException
com.rs.lic.LicenseVerificationException
XBRLValidationExceptionpublic XBRLArcroleType getVariableSetArcroleType()
public XBRLArcroleType getVariableFilterArcroleType()
public XBRLArcroleType getVariableSetFilterArcroleType()
public XBRLArcroleType getVariableSetPreconditionArcroleType()
public XBRLArcroleType getEqualityDefinitionArcroleType()
public XBRLArcroleType getConsistencyAssertionParameterArcroleType()
public XBRLArcroleType getConsistencyAssertionFormulaArcroleType()
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)
XBRLPlugInProcessor
validate in interface XBRLPlugInProcessorXBRLValidationReportpublic XBRLValidationReport validate(XBRLInstance doc)
doc - input instance document
public AspectsCache getAspectsCache()
For internal use only.
public FilterMemberCache getFilterMemberCache()
public void informRunning(AssertionExecutor ae)
ae -
public void informEnd(AssertionExecutor ae,
long elapsedTime)
ae - elapsedTime - public void removeInScopeInstance(XBRLInstance doc)
doc - public void addInScopeInstance(XBRLInstance doc)
doc - public void setUnderEvaluationFormula(XBRLFormula formula)
formula - instance of an XBRLFormula or null to unset the value after
formula execution is finishedgetUnderEvaluationFormula()public XBRLFormula getUnderEvaluationFormula()
setUnderEvaluationFormula(XBRLFormula)
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.consistencycheck - public 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 void compileResources()
throws XFValidationException
XFValidationException
net.sf.saxon.trans.XPathException
public void addVariableParameter(XBRLVariableParameter variableParameter)
throws XFxbrlveParameterNameClash
variableParameter -
XFxbrlveParameterNameClashpublic void addCustomFunctionLibrary(XBRLRSCustomFunctionLibrary fl)
fl - the new FunctionLibrary instancepublic void addFormula(XBRLFormula formula)
formula -
public 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 -
public net.sf.saxon.s9api.XPathCompiler getFPXPathCompiler(net.sf.saxon.om.NamespaceResolver namespaceResolver,
XMLFragment fragment,
boolean schemaAware)
namespaceResolver - fragment - 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 - declaredVars - public 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 with 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 void setParametersResolver(XBRLFormulaParametersResolver pResolver)
pResolver - public XBRLFormulaParametersResolver getParameterResolver()
public void removeFormula(XBRLFormula xbrlFormula)
The function does nothing if the formula is already removed.
xbrlFormula - public java.lang.String getDescription()
XBRLPlugInProcessor
getDescription in interface XBRLPlugInProcessorpublic java.lang.String getName()
XBRLPlugInProcessor
getName in interface XBRLPlugInProcessorpublic static java.lang.String getDescriptionStatic()
public void addAssertion(XBRLAssertion assertion)
xbrlAssertion - public void addCustomFunctionDeclaration(XBRLCustomFunction customFunction)
xbrlCustomFunction - public void addConsistencyAssertion(XBRLConsistencyAssertion consistencyAssertion)
xbrlConsistencyAssertion -
public boolean matcheable(XBRLFact fact1,
XBRLFact fact2,
int aspectModel,
XMLFragment context)
fact1 - fact2 -
public XBRLFact getCacheFact(net.sf.saxon.s9api.XdmNode factNode)
fact2 -
public XBRLUnit getUnitById(java.lang.String id,
java.net.URI documentURI)
id - documentURI -
public XMLFragment getElementById(java.lang.String id,
java.net.URI documentURI)
id1 - documentURI -
public XBRLContext getContextById(java.lang.String id,
java.net.URI documentURI)
id - documentURI -
public 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 - requiredVariables -
XFValidationExceptionpublic FormulaProcessorStatus getStatus()
public void setUnderEvaluationVariable(javax.xml.namespace.QName variableName)
variableName - public 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)
xbrlConsistencyAssertion - an instance of a class implementing the
HasUncoveredAspectValueResolver interface or null to unset the valuepublic HasUncoveredAspectValueResolver getUnderEvaluationUncoveredAspectValue()
public XBRLValidationReport evaluate(XBRLResource resource,
XBRLInstance instance)
This method is used by the GUI of the FormulaTT class.
resource -
public static java.lang.String cleanFormulaExpression(java.lang.String expression)
The method trims the expression and then replaces cr by spaces.
expression - string XPath expression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||