com.ihr.xbrl.om.exLinks
Class XBRLResource

java.lang.Object
  extended by com.ihr.xbrl.om.XMLFragment
      extended by com.ihr.xbrl.om.exLinks.XLinkElement
          extended by com.ihr.xbrl.om.exLinks.XBRLPointerOfARelationship
              extended by com.ihr.xbrl.om.exLinks.XBRLResource
All Implemented Interfaces:
XBRLRelationshipPoint, XBRLValidation, XBRLValueKey, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
Direct Known Subclasses:
FlMessage, XBRLFormulaResource, XBRLLabelResource

public class XBRLResource
extends XBRLPointerOfARelationship
implements XBRLValueKey, XBRLRelationshipPoint, XBRLValidation

This is the base type for XBRL resources. This object represents the content of an XBRL Resource as indicated in the XBRL Infoset documentation. Every other XBRL resource is derived from this XBRLResource and may overwrite methods in this class or any other class in the hierarchy tree. Label resources, for example, are implemented as XBRLLabelResource objects with additional properties, validation constraints etc.

Author:
Ignacio

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation
XBRLValidation.Direction
 
Field Summary
static XBRLResource nullResource
           
 
Fields inherited from class com.ihr.xbrl.om.exLinks.XLinkElement
actuate, ACTUATE, ARC, arcrole, ARCROLE, ETITLE, EXTENDED, from, FROM, href, HREF, label, LABEL, LOCATOR, RESOURCE, role, ROLE, show, SHOW, SIMPLE, title, TITLE, to, TO, TYPE
 
Fields inherited from class com.ihr.xbrl.om.XMLFragment
CONCEPT_LABEL, CONCEPT_QNAME, EMPTYRELATIONSHIPSITERATORINSTANCE, EMPTYXMLFRAGMENTITERATORINSTANCE, FACT_CONCEPT_DATATYPE, FACT_CONCEPT_LABEL, FACT_QNAME, idQName, NO_POSITION, OrderComparator, PERIOD_TYPE, PERIOD_VALUE, SHORT_TEXT, SOURCE_DOCUMENT, XPATH, XPOINTER
 
Constructor Summary
XBRLResource(XBRLExtendedLink parent, javax.xml.namespace.QName type, boolean bAddToParent)
          Creates a XBRLResource programatically Set bAddToParent to false if the resource is not fully initialized in this case this function never throws a XBRLDuplicateResource exception Starting with release 2.6.5 this constructor requires the element declaration of the type parameter to be loaded in the set of schemas available in the DTSContainer of the parent.
XBRLResource(XBRLExtendedLink parent, net.sf.saxon.s9api.XdmNode resNode)
          constructor of an XBRLResource object.
XBRLResource(XBRLResource other)
          Constructor of a resource based on another resource that is already in the resource cache of the container.
 
Method Summary
 void addChild(XMLFragment f)
          Sets the resource value to a comples type value and adds a fragment to it
 void clear()
          Removes all referneces to this resource in the DTS
 boolean equals(java.lang.Object other)
          Sets a new XPathFunctionResolver for this object
 XBRLLocator generateLocatorToNode(boolean relativize, java.net.URI base)
           
 org.jdom.Element generateNode(boolean relativize, java.net.URI base)
          Serializes to a jdom Element the representation of the properties of this Information Item This method should be called from classes derived from this class
 java.util.Iterator<XBRLAttribute> getAttributes()
          Access to the [Attributes] property
 DTSBase getDTSBase()
           
 java.lang.String getFriendlyName()
          Returns a string description that represents the element content in a form that users can understand.
 java.lang.String getFriendlyName(int modifiers, LabelsProvider lp)
          Returns a string description that represents the element content in a form that users can understand.
 XBRLExtendedLink getParent()
          Access to the [Parent] property
 XBRLRoleType getRoleType()
          Access to the [Role Type] property The resource is validated against the content of the roleType information Return null if no roleType exist on resource
 XBRLXSDTypeDefinition getType()
           
 XBRLValidationReport getValidationReport()
          Access to the last stored validation report
 net.sf.saxon.value.AnyURIValue getValueKey()
           
 int hashCode()
           
 void invalidate()
          Invalidates the XBRLFact for XBRL validation.
 boolean invalidate(XBRLValidation.Direction dir)
          Invalidates this object and the elements in the XML tree according with the parameter in dir This method is used by GUI tools that requires to reset validation before a manual validation cycle is started
 boolean isComplexType()
           
 boolean isOnValidation()
          When validation is a recursive process, this function returns true if the object going to be validated is already under validation.
 boolean isSimpleType()
           
 void setComplexType()
          Programatically sets if the resource type is simple or complex
 void setDTSBase(DTSBase base)
           
 void setId(java.lang.String id)
          Sets the content of the id attribute of this element the ID MUST not have any space, but null is allowed and removes an id from an XML Fragment.
 void setParent(XBRLExtendedLink parent)
          Sets the parent of this resource to the Extended link that is used in the parameter.
 void setRole(java.lang.String role)
          Sets the value of the xlink:role attribute to a specific value
 void setRoleType(XBRLRoleType role)
           
 void setSimpleType()
          Programatically sets if the resource type is simple or complex
 void setValue(net.sf.saxon.s9api.XdmValue v)
          Sets the resource value to a specific simple type value
 XBRLValidationReport validate(XBRLPlugInProcessor proc)
          Executes validation on the instance object and returns a validation report.
 
Methods inherited from class com.ihr.xbrl.om.exLinks.XLinkElement
getActuate, getArcrole, getFromTxt, getHRef, getLabel, getRole, getShow, getStaticLabel, getSType, getTitle, getToTxt, isRequiredAttribute, isValidAttribute, setActuate, setArcrole, setFrom, setHRef, setLabel, setShow, setSType, setTitle, setTo
 
Methods inherited from class com.ihr.xbrl.om.XMLFragment
addAttribute, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clone, clone, delAttribute, delAttribute, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAttribute, getAttributeQNameValue, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, getFragment, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getId, getLang, getNamespaceURI, getNodeName, getNumberOfAttributes, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticNamespace, getStringValue, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, isDead, isNamespaceDefined, objEquals, objHashCode, qNameToString, removeAttribute, removeChild, removeChild, removeFromRelationship, removeToRelationship, removeXMLChild, resetElements, resetHash, resolveHRef, resolveHRef, s_equal2, s_equal2, setAttributes, setBase, setDocument, setDocumentAndReload, setElements, setLang, setNamespaceContext, setNamespaces, setNode, setNodeName, setParent, setValue, setVariablesDefined, toString, valueEquals, xEqual
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ihr.xbrl.om.exLinks.XBRLRelationshipPoint
addFromRelationship, addToRelationship, getFromRelationships, getToRelationships, removeFromRelationship, removeToRelationship
 

Field Detail

nullResource

public static final XBRLResource nullResource
Constructor Detail

XBRLResource

public XBRLResource(XBRLExtendedLink parent,
                    net.sf.saxon.s9api.XdmNode resNode)
constructor of an XBRLResource object. This class creates an instance of a XBRL resource and registers it in the container.

Parameters:
parent -
resNode -
Throws:
XBRLValidationException

XBRLResource

public XBRLResource(XBRLResource other)
Constructor of a resource based on another resource that is already in the resource cache of the container. This method will replace the old resource from the DTS and add a new resource (of a different type) at the same place.

Parameters:
other -
Throws:
XBRLValidationException
DTSDiscoveryException
XBRLValidationException

XBRLResource

public XBRLResource(XBRLExtendedLink parent,
                    javax.xml.namespace.QName type,
                    boolean bAddToParent)
Creates a XBRLResource programatically Set bAddToParent to false if the resource is not fully initialized in this case this function never throws a XBRLDuplicateResource exception Starting with release 2.6.5 this constructor requires the element declaration of the type parameter to be loaded in the set of schemas available in the DTSContainer of the parent.

Parameters:
parent - XBRLExtendedLink the extended link
type - QName the type of this new resource
bAddToParent - if this is true the resource will be added to the extended link and to the DTS Container.
Throws:
XBRLDuplicateResource
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class XMLFragment

equals

public boolean equals(java.lang.Object other)
Description copied from class: XMLFragment
Sets a new XPathFunctionResolver for this object

Overrides:
equals in class XMLFragment

getParent

public XBRLExtendedLink getParent()
Access to the [Parent] property

Specified by:
getParent in interface XMLHasParent
Overrides:
getParent in class XMLFragment
Returns:
XBRLExtendedLink

setParent

public void setParent(XBRLExtendedLink parent)
               throws XBRLDuplicateException
Sets the parent of this resource to the Extended link that is used in the parameter. If the resource had a previous parent this method detach the resource from previous parent and attach it to the new parent.

Parameters:
parent - XBRLExtendedLink
Throws:
XBRLDuplicateException

getRoleType

public XBRLRoleType getRoleType()
Access to the [Role Type] property The resource is validated against the content of the roleType information Return null if no roleType exist on resource

Returns:
XBRLRoleType
Throws:
XBRLValidationException

setRoleType

public void setRoleType(XBRLRoleType role)

setRole

public void setRole(java.lang.String role)
Description copied from class: XLinkElement
Sets the value of the xlink:role attribute to a specific value

Overrides:
setRole in class XLinkElement

getDTSBase

public DTSBase getDTSBase()

setDTSBase

public void setDTSBase(DTSBase base)
Parameters:
base - DTSBase

getAttributes

public java.util.Iterator<XBRLAttribute> getAttributes()
Access to the [Attributes] property

Overrides:
getAttributes in class XMLFragment
Returns:
Iterator

getType

public XBRLXSDTypeDefinition getType()

isComplexType

public boolean isComplexType()
Returns:
boolean

setComplexType

public void setComplexType()
Programatically sets if the resource type is simple or complex


setSimpleType

public void setSimpleType()
Programatically sets if the resource type is simple or complex


setValue

public void setValue(net.sf.saxon.s9api.XdmValue v)
Sets the resource value to a specific simple type value

Overrides:
setValue in class XMLFragment

setId

public void setId(java.lang.String id)
           throws XBRLInconsistentDTSException
Description copied from class: XMLFragment
Sets the content of the id attribute of this element the ID MUST not have any space, but null is allowed and removes an id from an XML Fragment. This method may be overwritten by other classes that require storing an indexed table of elements and IDs in order to prevent duplicate IDs to exist

Overrides:
setId in class XMLFragment
Parameters:
id - the new ID
Throws:
XBRLInconsistentDTSException - if the id is not lexicographically valid

addChild

public void addChild(XMLFragment f)
Sets the resource value to a comples type value and adds a fragment to it

Overrides:
addChild in class XMLFragment

isSimpleType

public boolean isSimpleType()
Returns:
boolean

generateNode

public org.jdom.Element generateNode(boolean relativize,
                                     java.net.URI base)
                              throws XBRLSerializationException
Description copied from class: XMLFragment
Serializes to a jdom Element the representation of the properties of this Information Item This method should be called from classes derived from this class

Overrides:
generateNode in class XLinkElement
Parameters:
relativize - boolean indicating if URIs should be relativized to the base URI (see next argument)
base - the URI to which some attributes of this object should be relativided
Returns:
a clone of the surrounding jdom Element so it can be incorporated into multiple trees
Throws:
XBRLSerializationException

generateLocatorToNode

public XBRLLocator generateLocatorToNode(boolean relativize,
                                         java.net.URI base)
                                  throws java.net.URISyntaxException
Parameters:
base -
relativize -
Returns:
XBRLLocator
Throws:
java.net.URISyntaxException

getValueKey

public net.sf.saxon.value.AnyURIValue getValueKey()
Specified by:
getValueKey in interface XBRLValueKey

clear

public void clear()
           throws java.lang.Throwable
Removes all referneces to this resource in the DTS

Overrides:
clear in class XMLFragment
Throws:
XBRLValidationException
java.lang.Throwable

getFriendlyName

public java.lang.String getFriendlyName()
Description copied from class: XMLFragment
Returns a string description that represents the element content in a form that users can understand. This method may be overridden by parent classes.

Remarks, this method may return very long names not suitable for user interface

Overrides:
getFriendlyName in class XMLFragment
Returns:
Non empty String. Internationalization is enabled

getFriendlyName

public java.lang.String getFriendlyName(int modifiers,
                                        LabelsProvider lp)
Description copied from class: XMLFragment
Returns a string description that represents the element content in a form that users can understand. This method may be override by parent classes.

This function accepts flags that are defined as constants in XMLFragment in order to modify the output.

Overrides:
getFriendlyName in class XMLFragment
Parameters:
modifiers - integer
Returns:
Non empty String. Internationalization is enabled

getValidationReport

public XBRLValidationReport getValidationReport()
Description copied from interface: XBRLValidation
Access to the last stored validation report

Specified by:
getValidationReport in interface XBRLValidation
Returns:
XBRLValidationReport or null if the object has not been validated or no errors exists

validate

public XBRLValidationReport validate(XBRLPlugInProcessor proc)
Description copied from interface: XBRLValidation
Executes validation on the instance object and returns a validation report.

The validation result may be cached internally. A call to XBRLValidation.invalidate(Direction) clears the validation cache.

Specified by:
validate in interface XBRLValidation
Parameters:
proc - the processor under which the object is going to be validated. Note the same object can be validated on multiple processors.
Returns:
the validation report or null if no errors.

invalidate

public void invalidate()
Description copied from interface: XBRLValidation
Invalidates the XBRLFact for XBRL validation.

Specified by:
invalidate in interface XBRLValidation

invalidate

public boolean invalidate(XBRLValidation.Direction dir)
Description copied from interface: XBRLValidation
Invalidates this object and the elements in the XML tree according with the parameter in dir

This method is used by GUI tools that requires to reset validation before a manual validation cycle is started

Specified by:
invalidate in interface XBRLValidation
Parameters:
dir - see the XBRLValidation.Direction enumeration for more information.

isOnValidation

public boolean isOnValidation()
Description copied from interface: XBRLValidation
When validation is a recursive process, this function returns true if the object going to be validated is already under validation. This prevents a recursive loop to enter the same validation component in an infinite loop.

Specified by:
isOnValidation in interface XBRLValidation
Returns:
true if the document is under validation. Means, the validation has not finished.


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