public class XBRLFormula extends XBRLVariableSetResource implements XMLEvaluationContextProvider, StaticCheck
XBRLValidation.Direction| Modifier and Type | Field and Description |
|---|---|
static javax.xml.namespace.QName |
decimals
The Constant decimals.
|
static net.sf.saxon.s9api.QName |
dimensionExplicit
The Constant dimensionExplicit.
|
static net.sf.saxon.s9api.QName |
dimensionTyped
The Constant dimensionTyped.
|
static net.sf.saxon.s9api.QName |
entityIdentifier
The Constant entityIdentifier.
|
static javax.xml.namespace.QName |
formula
The Constant formula.
|
static net.sf.saxon.s9api.QName |
formulaConcept
The Constant formulaConcept.
|
static org.apache.log4j.Logger |
log
The log.
|
static net.sf.saxon.s9api.QName |
occEmpty
The Constant occEmpty.
|
static net.sf.saxon.s9api.QName |
occFragments
The Constant occFragments.
|
static net.sf.saxon.s9api.QName |
occXPath
The Constant occXPath.
|
static net.sf.saxon.s9api.QName |
period
The Constant period.
|
static javax.xml.namespace.QName |
precision
The Constant precision.
|
static javax.xml.namespace.QName |
source
The Constant source.
|
static javax.xml.namespace.QName |
uncovered
The Constant uncovered.
|
static net.sf.saxon.s9api.QName |
unit
The Constant unit.
|
static javax.xml.namespace.QName |
value
The Constant value.
|
aspectModel, implicitFilteringnullResourceactuate, ACTUATE, ARC, arcrole, ARCROLE, ETITLE, EXTENDED, from, FROM, href, HREF, label, LABEL, LOCATOR, RESOURCE, role, ROLE, show, SHOW, SIMPLE, title, TITLE, to, TO, TYPECONCEPT_LABEL, CONCEPT_QNAME, EASY_TO_READ, ELEMENT_LABEL, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, HIDE_COMMON_ACCURACY, idQName, NO_POSITION, OrderComparator, OrderComparator2, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTERMODEL_DIMENSIONAL, MODEL_NON_DIMENSIONAL| Constructor and Description |
|---|
XBRLFormula(XBRLFormulaProcessor proc,
XBRLExtendedLink parent,
net.sf.saxon.s9api.XdmNode resNode)
Creates a new formula from a node in an extended link.
|
XBRLFormula(XBRLFormulaProcessor proc,
XBRLResource other)
Formulas are normally created by copying another existing resource.
|
| Modifier and Type | Method and Description |
|---|---|
XBRLInstance |
evaluateFormula(XBRLInstance doc,
XBRLInstance instance)
Evaluates a formula and returns an instance document containing the formula output.
|
int |
getAllAspectsIndicated()
Access to a bit map of flags for the aspects indicated on this formula.
|
XMLFragment |
getEvaluationContext()
Gets the evaluation context.
|
java.lang.String |
getExpression()
Access to the xpath expression inside this formula resource.
|
TraceVariablesBind |
getTraceVariablesBind()
During the formula evaluation, this variable may be set to store a trace of variable bindings.
|
boolean |
isTheSourceOf(XBRLFact fact)
This method returns true if this formula is the source of a fact generation.
|
void |
setExecutionTarget(ExecutionTargetType type)
Set or changes the target execution for this formula.
|
void |
staticCheck()
Resources that has static checking implements this interface.
|
void |
staticCheckAspectRules()
Called during the compilation of the resource.
|
allDimensions, bindCycle, bindLastEvaluatedVariableValues, bindParameters, bindVariableValue, checkCyclicDependencies, compileFilters, compileFormulaExpression, declareVariables, getAspectModel, getBindableVariableNames, getFilters, getNumberOfVariables, getOptimizer, getUncoveredAspectsSet, getUncoveredAspectValue, getVariableResource, getVariableResourceUses, getVariableUse, getVariableValue, getVariableValue, getXFIImplicitFilterOptimizer, isCovered, isImplicitFiltergetProcessoraddChild, clear, equals, generateLocatorToNode, generateNode, getAttributes, getDTSBase, getFriendlyName, getFriendlyName, getParent, getResourceIdentifier, getRoleType, getType, getValidationReport, getValueKey, hashCode, invalidate, invalidate, isComplexType, isOnValidation, isSimpleType, setComplexType, setDTSBase, setId, setParent, setRole, setRoleType, setSimpleType, setValue, validategetActuate, getArcrole, getFromTxt, getHRef, getLabel, getRole, getShow, getStaticLabel, getSType, getTitle, getToTxt, isRequiredAttribute, isValidAttribute, setActuate, setArcrole, setFrom, setHRef, setLabel, setShow, setSType, setTitle, setToaddAttribute, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clone, clone, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAllAttributes, getAttribute, getAttributeBooleanValue, getAttributeQNameValue, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, getElementsHashCode, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getGenericLabelText, getId, getLang, getNamespaceURI, getNodeName, getNumberOfAttributes, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticContext, getStaticNamespace, getStringValue, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathExecutable, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, isXdmDocumentAttached, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolve_equal2, resolveHRef, resolveHRef, s_equal2, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setRegenerateNodeIfnotFound, setValue, setVariablesDefined, size, thin, toString, valueEquals, xEqualgetProcessoraddFromRelationship, addToRelationship, getFromRelationships, getToRelationships, removeFromRelationship, removeToRelationshippublic static org.apache.log4j.Logger log
public static final javax.xml.namespace.QName value
public static final javax.xml.namespace.QName source
public static final javax.xml.namespace.QName decimals
public static final javax.xml.namespace.QName precision
public static final javax.xml.namespace.QName formula
public static final javax.xml.namespace.QName uncovered
public static final net.sf.saxon.s9api.QName formulaConcept
public static final net.sf.saxon.s9api.QName entityIdentifier
public static final net.sf.saxon.s9api.QName period
public static final net.sf.saxon.s9api.QName unit
public static final net.sf.saxon.s9api.QName occEmpty
public static final net.sf.saxon.s9api.QName occFragments
public static final net.sf.saxon.s9api.QName occXPath
public static final net.sf.saxon.s9api.QName dimensionExplicit
public static final net.sf.saxon.s9api.QName dimensionTyped
public XBRLFormula(XBRLFormulaProcessor proc, XBRLExtendedLink parent, net.sf.saxon.s9api.XdmNode resNode) throws XFValidationException
proc - the procparent - XBRLExtendedLink parent of this new formularesNode - XdmNode saxon node defined in saxon s9apiXFValidationException - the XF validation exceptionpublic XBRLFormula(XBRLFormulaProcessor proc, XBRLResource other) throws XFValidationException
proc - the procother - XBRLResourceXFValidationException - the XF validation exceptionpublic void setExecutionTarget(ExecutionTargetType type)
type - the new execution targetpublic void staticCheck()
throws XFValidationException
StaticCheckIn case of errors, the staticCheck method raises XFValidationException
staticCheck in interface StaticCheckXFValidationException - if static errors occurspublic void staticCheckAspectRules()
throws XFValidationException
This method updates the internal variable allAspectsIndicated
XFValidationException - the XF validation exceptionpublic java.lang.String getExpression()
public int getAllAspectsIndicated()
public TraceVariablesBind getTraceVariablesBind()
public XBRLInstance evaluateFormula(XBRLInstance doc, XBRLInstance instance) throws XFValidationException
Current version of the formula specification indicates that the formula output is just a single fact. In the opinion of the author of this code, this is just one sign of bad quality specifications.
Nothing would stop the formula authors to produce a sequence of facts as a result of a formula evaluation because the formula output can be easily enclosed inside a single instance document (containing one or a set of facts). This API has been designed this way in order to allow that possible feature in the future while provides the required functionality in the current document wording.
doc - the "target instance" as defined in the formula specification. This is the instance from which variable values will be obtainedinstance - instance document to add generated facts to. This method will write values to instance. can be null, in this case, a new instance document is created inside this function.XFValidationException - if errors occurs during the formula executionpublic XMLFragment getEvaluationContext()
XMLEvaluationContextProvidergetEvaluationContext in interface XMLEvaluationContextProviderpublic boolean isTheSourceOf(XBRLFact fact)
fact - the fact