public class XBRLFormula extends XBRLVariableSetResource implements XMLEvaluationContextProvider, StaticCheck
XBRLVariableSetResource.PreconditionAndSelectorXMLFragment.NodeNameIterator<T extends XMLFragment>, XMLFragment.NodeTypeIterator<T extends XMLFragment>XBRLVariablesHolder.ModelTypeXBRLValidation.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, ARC, arcrole, ETITLE, EXTENDED, from, href, label, LOCATOR, RESOURCE, role, show, SIMPLE, title, to, X_ACTUATE, X_ARCROLE, X_FROM, X_HREF, X_LABEL, X_ROLE, X_SHOW, X_TITLE, X_TO, X_TYPE, XLINKPREFIXADD_NAMESPACE_INHERIT, baseQName, CONCEPT_LABEL, CONCEPT_QNAME, EASY_TO_READ, ELEMENT_LABEL, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, FACT_VALUE, HIDE_COMMON_ACCURACY, idQName, langQName, nil, NO_POSITION, OrderComparator, OrderComparator2, OrderComparatorReverse, PERIOD_BOP, PERIOD_TYPE, PERIOD_VALUE, RELATIONSHIP_TYPE, RESOURCE_TYPE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER| Constructor and Description |
|---|
XBRLFormula(XBRLFormulaProcessor proc,
XBRLExtendedLink parent,
XMLFragment node)
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 |
|---|---|
void |
clear()
Clear.
|
XBRLInstance |
evaluateFormula(XBRLInstanceRootNode doc,
XBRLInstance instance,
XBRLEvaluationContext evalContext)
Evaluates a formula and returns an instance document containing the formula output.
|
java.util.Set<Aspect> |
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.
|
net.sf.saxon.tree.linked.NodeImpl |
getFirstChild() |
net.sf.saxon.tree.linked.NodeImpl |
getLastChild() |
int |
getNumberOfChildren() |
TraceVariablesBind |
getTraceVariablesBind()
During the formula evaluation, this variable may be set to store a trace of variable bindings.
|
boolean |
hasChildNodes() |
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()
Static check.
|
void |
staticCheckAspectRules()
Called during the compilation of the resource.
|
bindCycle, bindLastEvaluatedVariableValues, bindParameters, bindVariableValue, checkCyclicDependencies, compileFilters, compileFormulaExpression, declareVariables, evaluatePrecondition, evaluatePreconditions, getAspectModel, getBindableVariableNames, getCoveredAspectsSet, getFilters, getNumberOfVariables, getPreconditions, getUncoveredAspectValue, getUncoveredDimensionalAspects, getUncoveredNonDimensionalAspects, getVariableResource, getVariableResourceUses, getVariableUse, getVariableValue, getVariableValue, getVariableValue, getXFIImplicitFilterOptimizer, isCovered, isImplicitFilteraddRequiredVariable, clearVariableSetDicoveredDuringExpressionCompilation, getProcessor, getRequiredVariableSetDiscoveredDuringExpressionCompilation, getResourceaddChild, clone, clone, equals, generateNode, getAttributes, getCode, getDTSBase, getFriendlyName, getFriendlyName, getFriendlyName, getParentXBRL, getResourceIdentifier, getRoleType, getType, getValidationReport, getValueKey, hashCode, invalidate, invalidate, isComplexType, isHashDependsOnAtribute, isOnValidation, isSimpleType, setCode, setComplexType, setDTSBase, setId, setRawParentXBRL, setRole, setRoleType, setSimpleType, setValue, validategetActuate, getArcrole, getFromTxt, getHRef, getHRefDocument, getHRefDocumentResolved, getHRefResolved, getLabel, getRawHRef, getReference, getRole, getShow, getStaticLabel, getSType, getTitle, getToTxt, isRequiredAttribute, isValidAttribute, setActuate, setArcrole, setFrom, setHRef, setLabel, setShow, setSType, setTitle, setTo, validateXPointeraddAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addChildArray, addChildAt, addChildNode, addChildNodeArray, addChildNodeAt, addChildNodeInBatch, addComment, addFromRelationship, addNamespace, addNamespace, addPropertyChangeListener, addToRelationship, changeBase, checkBase, childExists, commitBatch, copy, createComment, delAttribute, delAttribute, delete, equalXdmValues, findFirstNodeOfClass, findPosition, firePropertyChangeEvent, generateId, generateLocatorToNode, generatePrefix, getAllAttributes, getAttribute, getAttributeAtomicValue, getAttributeBooleanValue, getAttributeGroundedValue, getAttributeQNameValue, getAttributeValue, getBase, getBase, getBooleanValue, getChildren, getChildStringValue, getConfiguration, getContainer, getContainerDocumentURI, getDocument, getElement, getElement, getElements, getFirstChildNoComment, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getId, getInScopeNamespaces, getLang, getLastChildNoComment, getNamePool, getNamespaceBinding, getNamespaceURI, getNextSiblingNoComment, getNodeName, getNthElement, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getParentDocument, getPrefix, getPrefixes, getPropertyChangeListeners, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getStringValue, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPath, getXPathFromXPointer, getXPathNamespaceContext, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerXPath2Scheme, initialise, internalToString, isAttribute, isChangeHashEnabled, isDead, isEmpty, isNamespaceDefined, isNil, moveNamespacesUp, objEquals, objHashCode, reindex, removeChild, removeChildNode, removeFromRelationship, removeNamespace, removePropertyChangeListener, removeToRelationship, replace, replaceChild, replaceStringValue, resetElements, resolveHRef, s_equal2_xp2, s_equal2_xp2, s_equal2, s_equal2, s_equal2, s_equal2, setAttributeList, setAttributes, setBase, setChildrenClone, setDirty, setElements, setLang, setModified, setNamespaceDeclarations, setNamespaces, setNil, setNodeName, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toString, valueEquals, xEqualaddAttribute, addNamespace, generateId, getAttributeList, getAttributeValue, getAttributeValue, getBaseURI, getColumnNumber, getDeclaredNamespaces, getDocumentRoot, getLineNumber, getNameCode, getNamespaceList, getNodeKind, getRoot, getSchemaType, getSystemId, getTypeAnnotation, getURIForPrefix, gsetAttributeCollection, isId, isInScopeNamespace, isNilled, iteratePrefixes, removeAttribute, removeTypeAnnotation, rename, setLocation, setNameCode, setNamespaceList, setSystemId, setTypeAnnotationatomize, compareOrder, comparePosition, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getSiblingPosition, getSuccessorElement, getURI, head, insertSiblings, isDeleted, isIdref, isSameNodeInfo, iterate, iterateAxis, iterateAxis, newBuilder, replacegetResourcegetProcessorpublic 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, XMLFragment node) throws XFValidationException
proc - the procparent - XBRLExtendedLink parent of this new formulanode - XMLFragment 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
staticCheck in interface StaticCheckXFValidationException - the XF validation exceptionpublic void staticCheckAspectRules()
throws XFValidationException
This method updates the internal variable allAspectsIndicated
XFValidationException - the XF validation exceptionpublic java.lang.String getExpression()
public java.util.Set<Aspect> getAllAspectsIndicated()
public TraceVariablesBind getTraceVariablesBind()
public XBRLInstance evaluateFormula(XBRLInstanceRootNode doc, XBRLInstance instance, XBRLEvaluationContext evalContext) 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.evalContext - the eval contextXFValidationException - if errors occurs during the formula executionpublic XMLFragment getEvaluationContext()
getEvaluationContext in interface XMLEvaluationContextProviderpublic boolean isTheSourceOf(XBRLFact fact)
fact - the factpublic void clear()
throws java.lang.Throwable
clear in class XBRLVariableSetResourcejava.lang.Throwable - the throwablepublic final boolean hasChildNodes()
hasChildNodes in interface net.sf.saxon.om.NodeInfohasChildNodes in class net.sf.saxon.tree.linked.NodeImplpublic final int getNumberOfChildren()
public final net.sf.saxon.tree.linked.NodeImpl getFirstChild()
getFirstChild in interface net.sf.saxon.tree.util.SteppingNode<net.sf.saxon.tree.linked.NodeImpl>getFirstChild in class net.sf.saxon.tree.linked.NodeImplpublic final net.sf.saxon.tree.linked.NodeImpl getLastChild()
getLastChild in class net.sf.saxon.tree.linked.NodeImplCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa