com.ihr.xbrl.om.xdt
Class XDTFact

java.lang.Object
  extended by com.ihr.xbrl.om.xdt.XDTFact
Direct Known Subclasses:
XDTFactForApplications

public class XDTFact
extends java.lang.Object

This is a fact in the instance document that can be validated against the XDT specification.

Author:
Ignacio

Constructor Summary
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
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getDimensionPreferredContainer(javax.xml.namespace.QName dimension)
           
 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)
           
 XBRLFactItem getFact()
           
 XDTProcessor getProcessor()
           
 int hashCode()
           
 boolean validate(java.lang.StringBuffer reasonError)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDTFact

public 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

Parameters:
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)
Method Detail

getFact

public XBRLFactItem getFact()
Returns:
the fact

getProcessor

public XDTProcessor getProcessor()
Returns:
the processor

getDimensionValue

public java.lang.Object getDimensionValue(int container,
                                          javax.xml.namespace.QName dimension)
Obtains the value for a dimension on this fact level.

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).

Parameters:
container - integer constant XDTHypercubeUse.SEGMENT or XDTHypercubeUse.SCENARIO
dimension - the dimension QName
Returns:
Object, if the dimension is explicit, the function returns the QName value. if the dimension is typed the function returns the XML node

getDimensionValue

public java.lang.Object getDimensionValue(javax.xml.namespace.QName dimension)
Parameters:
dimension -
Returns:
See Also:
getDimensionValue(int, QName)

getDimensionPreferredContainer

public int getDimensionPreferredContainer(javax.xml.namespace.QName dimension)
Parameters:
dimension -
Returns:
See Also:
{@link XDTHypercubeUse#SEGMENT} or {@link XDTHypercubeUse#SCENARIO} or {@link XDTHypercubeUse#UNDEFINED}

validate

public boolean validate(java.lang.StringBuffer reasonError)
Parameters:
reasonError - if the result is invalid, this string buffer contains human readable explanation about the reason
Returns:
boolean true if valid, false if not valid

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa