public class XDTFact
extends java.lang.Object
Constructor and Description |
---|
XDTFact(javax.xml.namespace.QName primaryItemQName,
XDTProcessor processor,
java.util.Map<javax.xml.namespace.QName,XMLFragment> segmentDimData,
java.util.Map<javax.xml.namespace.QName,XMLFragment> scenarioDimData)
Creates a new XDTFact object without a backup primary item.
|
XDTFact(XBRLFactItem fact,
XDTProcessor processor,
boolean bThrowValidationExceptions)
Creates a new XDTFact object, this is, the representation of a fact with its dimensions
according to the XDT Specification 1.0
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Equals.
|
int |
getDimensionPreferredContainer(javax.xml.namespace.QName dimension)
Gets the dimension preferred container.
|
java.lang.Object |
getDimensionValue(int container,
javax.xml.namespace.QName dimension)
Obtains the value for a dimension on this fact level.
|
java.lang.Object |
getDimensionValue(javax.xml.namespace.QName dimension)
Gets the dimension value.
|
XBRLFactItem |
getFact()
Gets the fact.
|
XDTProcessor |
getProcessor()
Gets the processor.
|
int |
hashCode()
Hash code.
|
boolean |
isDefaultValue(javax.xml.namespace.QName dimension)
Returns a boolean value indicating whether for this fact the dimension value is the dimension default or not.
|
boolean |
validate(java.lang.StringBuilder reasonError,
XDTValidationFactHistory valTrack)
Validate.
|
public XDTFact(XBRLFactItem fact, XDTProcessor processor, boolean bThrowValidationExceptions)
fact
- the surrounding fact item. null is allowed here. (if required for GUIs)processor
- the instance of the XDTProcessor to use (just in case fact is null)bThrowValidationExceptions
- if this parameter is true, the process of getting the dimensions from the
context (during the object creation process) may raise XDTValidation exceptions. If this parameter is
false an exception will not be raised (even if the context is not valid)public XDTFact(javax.xml.namespace.QName primaryItemQName, XDTProcessor processor, java.util.Map<javax.xml.namespace.QName,XMLFragment> segmentDimData, java.util.Map<javax.xml.namespace.QName,XMLFragment> scenarioDimData)
primaryItemQName
- the primary item q nameprocessor
- the instance of the XDTProcessor to use (just in case fact is null)segmentDimData
- the segment dim datascenarioDimData
- the scenario dim datapublic XBRLFactItem getFact()
public XDTProcessor getProcessor()
public java.lang.Object getDimensionValue(int container, javax.xml.namespace.QName dimension)
This value is not for validation purposes, but for application consumption.
If container is -1 only the default value is returned.
If container is either XDTHypercubeUse.SEGMENT or XDTHypercubeUse.SCENARIO the value returned is the explicitly value set or the default value if there is none and the dimension has a default.
For this function it is not an error to have the same dimension in both containers (with the same or different values)
as that was the interpretation of the specification before errata corrections on 2009/09/07. Now there are two other
functions (NOT RECOMMENDED) getDimensionValue(QName)
and getDimensionPreferredContainer(QName)
that
considers that one dimension can only exist in one dimension container (according to the new interpretation of the XDT
spec that is inconsistent with the XBRL 2.1 spec).
container
- integer constant XDTHypercubeUse.SEGMENT
or XDTHypercubeUse.SCENARIO
dimension
- the dimension QNamepublic boolean isDefaultValue(javax.xml.namespace.QName dimension)
Note this function is never used during XDT validation as the algorithm for validation does not requires this information. This is just a helper function for applications.
If the dimension does not exists in the DTS this function returns "true".
If the dimension does not define a default this function returns "false".
For typed dimensions this function returns "false".
dimension
- the dimension QNamepublic java.lang.Object getDimensionValue(javax.xml.namespace.QName dimension)
dimension
- the dimensiongetDimensionValue(int, QName)
public int getDimensionPreferredContainer(javax.xml.namespace.QName dimension)
dimension
- the dimension{@link XDTHypercubeUse#SEGMENT} or {@link XDTHypercubeUse#SCENARIO} or {@link XDTHypercubeUse#UNDEFINED}
public boolean validate(java.lang.StringBuilder reasonError, XDTValidationFactHistory valTrack)
reasonError
- if the result is invalid, this string buffer contains human readable explanation about the reasonvalTrack
- stores information about the validation process of this fact in order to produce a message at the end of the processpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the objCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa