com.ihr.xbrl.om.exLinks

## Class XBRLRelationship

- java.lang.Object
- - com.ihr.xbrl.om.XMLFragment
  - - com.ihr.xbrl.om.exLinks.XLinkElement
    - - com.ihr.xbrl.om.exLinks.XBRLRelationship

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, XBRLRelationshipPoint, Thinable, XBRLValidation, XMLHasParent, java.io.Serializable, java.lang.Cloneable, javax.xml.namespace.NamespaceContext

      public class XBRLRelationship
      extends XLinkElement
      implements java.io.Serializable, XBRLValidation

  The Class XBRLRelationship.
  Author:
    Ignacio
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.ihr.xbrl.om.XBRLValidation

      `XBRLValidation.Direction`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static javax.xml.namespace.QName` | `orderQName` The Constant orderQName.
    `static javax.xml.namespace.QName` | `priorityQName` The Constant priorityQName.
    `static javax.xml.namespace.QName` | `useQName` The Constant useQName.

    - ### Fields inherited from class com.ihr.xbrl.om.exLinks.XLinkElement

      `actuate, ACTUATE, ARC, arcrole, ARCROLE, ETITLE, EXTENDED, FROM, href, HREF, label, LABEL, LOCATOR, RESOURCE, role, ROLE, show, SHOW, SIMPLE, title, TITLE, TO, type, TYPE`

    - ### Fields inherited from class com.ihr.xbrl.om.XMLFragment

      `CONCEPT_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, XPOINTER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBRLRelationship(XBRLExtendedLink parent, DTSContainer dts, XBRLArcroleType arcroleType, XMLFragment from, XMLFragment to, net.sf.saxon.s9api.XdmNode document, XBRLAttribute[] attributes)` Creates a new relationship object from a XdmNode in a file parent linkbaseType - QName returned by the baseArc.getLinkbaseType()
    `XBRLRelationship(XBRLExtendedLink parent, javax.xml.namespace.QName type, XMLFragment from, XMLFragment to, XBRLArcroleType arcroleType, XBRLAttribute[] attributes, boolean bValidate)` Creates a new relationship object programatically.
    `XBRLRelationship(XBRLRelationship other)` Instantiates a new XBRL relationship.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear.
    `boolean` | `equals(java.lang.Object obj)` Sets a new XPathFunctionResolver for this object.
    `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
    `XBRLArcroleType` | `getArcroleType()` Access to the [Arcrole] property.
    `java.util.Iterator<XBRLAttribute>` | `getAttributes()` Access to the [Attributes] property.
    `XBRLRelationshipsChainLink` | `getChain()` Gets the chain.
    `DTSBase` | `getDTSBase()` Returns the base property of this relationship.
    `java.lang.String` | `getFriendlyName()` Returns a string description that represents the element content in a form that users can understand.
    `XMLFragment` | `getFrom()` Access to the [From] property of a relationship.
    `java.util.Iterator<XBRLRelationship>` | `getNext()` Access to the [Following] property of the chain of relationships.
    `java.lang.Double` | `getOrder()` Gets the order.
    `XBRLExtendedLink` | `getParent()` Access to the [Parent] property.
    `java.util.Iterator<XBRLRelationship>` | `getPrevious()` Access to the [Preceding] property of the chain of relationships.
    `int` | `getPriority()` Access to the [Priority] property.
    `XMLFragment` | `getSource()` The relationship [source] is the same as the relationship [From] property.
    `XMLFragment` | `getTarget()` The relationship [target] is the same as the relationship [To] property.
    `XMLFragment` | `getTo()` Access to the [To] property of a relationship.
    `javax.xml.namespace.QName` | `getType()` Access to the [Type] property The [Type] property of a relationship is the node name of the surrounding arc link:presentationArc, link:labelArc, link:calculationArc are some examples of values for the [Type] property .
    `java.lang.Integer` | `getUse()` Access to the [Use] property.
    `static java.lang.String` | `getUse(int useCode)` Gets the use.
    `static int` | `getUse(java.lang.String code)` Used to convert from string value of use to the integer value.
    `XBRLValidationReport` | `getValidationReport()` Access to the last stored validation report.
    `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` | `isOnValidation()` When validation is a recursive process, this function returns true if the object going to be validated is already under validation.
    `void` | `setArcrole(java.lang.String arcrole)` Sets the value of the xlink:arcrole attribute on simple link elements.
    `void` | `setArcroleType(XBRLArcroleType arcrole)` Sets the value of the [Arcrole] property of this relationship.
    `void` | `setChain(XBRLRelationshipsChainLink chain)` Sets the chain.
    `void` | `setDTSBase(DTSBase base)` Sets the base property of this relationship.
    `void` | `setFrom(XMLFragment newFrom)` sets the [From] property of this relationship
    `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.
    `java.lang.Double` | `setOrder(java.lang.Double newValue)` Set the value of the order attribute.
    `void` | `setParent(XBRLExtendedLink parent)` Sets the parent of this relationship to a new extended link.
    `java.lang.Integer` | `setPriority(java.lang.Integer newValue)` Sets the value of the [Priority] property or resets it if null is used as the new value.
    `void` | `setTo(XMLFragment newTo)` Sets the [To] property of this relationship.
    `void` | `setType(javax.xml.namespace.QName type)` Sets the [Type] property of this relationship.
    `java.lang.Integer` | `setUse(java.lang.Integer newValue)` Sets the value of the [Use] property to XBRLArc.OPTIONAL or XBRLArc.PROHIBITED or reset the value if null is used
    `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, setFrom, setHRef, setLabel, setRole, setShow, setSType, setTitle, setTo`

    - ### Methods inherited from class com.ihr.xbrl.om.XMLFragment

      `addAttribute, addChild, 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, getFriendlyName, 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, setValue, setVariablesDefined, size, thin, toString, valueEquals, xEqual`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### useQName

          public static final javax.xml.namespace.QName useQName

      The Constant useQName.

    - #### orderQName

          public static final javax.xml.namespace.QName orderQName

      The Constant orderQName.

    - #### priorityQName

          public static final javax.xml.namespace.QName priorityQName

      The Constant priorityQName.

  - ### Constructor Detail

    - #### XBRLRelationship

          public XBRLRelationship(XBRLExtendedLink parent,
                          DTSContainer dts,
                          XBRLArcroleType arcroleType,
                          XMLFragment from,
                          XMLFragment to,
                          net.sf.saxon.s9api.XdmNode document,
                          XBRLAttribute[] attributes)
                           throws XBRLValidationException

      Creates a new relationship object from a XdmNode in a file parent linkbaseType - QName returned by the baseArc.getLinkbaseType()
      Parameters:
        `parent` - XBRLExtendedLink of the base arc
        `dts` - DTSContainer
        `arcroleType` - XBRLArcroleType object
        `from` - XMLFragment in the from extreme of this relationship
        `to` - XMLFragment in the to extreme of this relationship
        `document` - NodeInfo surounding node
        `attributes` - XBRLAttribute[] Array of attributes to add to the attributes in the XdmNode. null is a valid value
      Throws:
        `XBRLValidationException`

    - #### XBRLRelationship

          public XBRLRelationship(XBRLExtendedLink parent,
                          javax.xml.namespace.QName type,
                          XMLFragment from,
                          XMLFragment to,
                          XBRLArcroleType arcroleType,
                          XBRLAttribute[] attributes,
                          boolean bValidate)
                           throws XBRLValidationException

      Creates a new relationship object programatically. parent linkbaseType - QName returned by the baseArc.getLinkbaseType()
      Parameters:
        `parent` - XBRLExtendedLink of the base arc
        `type` - QName relationship node of the arc
        `from` - XMLFragment in the from extreme of this relationship
        `to` - XMLFragment in the to extreme of this relationship
        `arcroleType` - XBRLArcroleType object
        `attributes` - XBRLAttribute[] Array of attributes. Attributes will be "cloned" before linked to this relationship. May be null
        `bValidate` - if this is false then the new relationship will not be validated against the XBRL 2.1 specification
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### XBRLRelationship

          public XBRLRelationship(XBRLRelationship other)
                           throws XBRLValidationException

      Instantiates a new XBRL relationship.
      Parameters:
        `other` - the other
      Throws:
        `XBRLValidationException` - the XBRL validation exception

  - ### Method Detail

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `XMLFragment`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Description copied from class: `XMLFragment`
      Sets a new XPathFunctionResolver for this object.
      Overrides:
        `equals` in class `XMLFragment`
      Parameters:
        `obj` - the other
      Returns:
        true, if successful

    - #### clear

          public void clear()
                     throws java.lang.Throwable

      Clear.
      Overrides:
        `clear` in class `XMLFragment`
      Throws:
        `java.lang.Throwable` - the throwable

    - #### 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

    - #### getFrom

          public XMLFragment getFrom()

      Access to the [From] property of a relationship.
      Returns:
        XMLFragment

    - #### getSource

          public XMLFragment getSource()

      The relationship [source] is the same as the relationship [From] property.
      Returns:
        XMLFragment
      Since:
        2.7.5
      See Also:
        `getFrom()`

    - #### getTo

          public XMLFragment getTo()

      Access to the [To] property of a relationship.
      Returns:
        XMLFragment

    - #### getTarget

          public XMLFragment getTarget()

      The relationship [target] is the same as the relationship [To] property.
      Returns:
        XMLFragment
      Since:
        2.7.5
      See Also:
        `getTo()`

    - #### getParent

          public XBRLExtendedLink getParent()

      Access to the [Parent] property. if the relationship does not have a base arc and parent was not set this method returns null
      Specified by:
        `getParent` in interface `XMLHasParent`
      Overrides:
        `getParent` in class `XMLFragment`
      Returns:
        XBRLExtendedLink

    - #### setParent

          public void setParent(XBRLExtendedLink parent)
                         throws XBRLInconsistentDTSException

      Sets the parent of this relationship to a new extended link.
      Parameters:
        `parent` - the new parent
      Throws:
        `XBRLInconsistentDTSException` - the XBRL inconsistent dts exception

    - #### getType

          public javax.xml.namespace.QName getType()

      Access to the [Type] property The [Type] property of a relationship is the node name of the surrounding arc link:presentationArc, link:labelArc, link:calculationArc are some examples of values for the [Type] property .
      Returns:
        QName

    - #### setType

          public void setType(javax.xml.namespace.QName type)

      Sets the [Type] property of this relationship.
      Parameters:
        `type` - the new type

    - #### getArcroleType

          public XBRLArcroleType getArcroleType()

      Access to the [Arcrole] property. Returns null if the relationship has a null DTSContainer.
      Returns:
        the arcrole type

    - #### setArcroleType

          public void setArcroleType(XBRLArcroleType arcrole)

      Sets the value of the [Arcrole] property of this relationship.
      Parameters:
        `arcrole` - the new arcrole type

    - #### setArcrole

          public void setArcrole(java.lang.String arcrole)

      Description copied from class: `XLinkElement`
      Sets the value of the xlink:arcrole attribute on simple link elements.
      Overrides:
        `setArcrole` in class `XLinkElement`
      Parameters:
        `arcrole` - the new arcrole

    - #### getNext

          public java.util.Iterator<XBRLRelationship> getNext()

      Access to the [Following] property of the chain of relationships.
      Returns:
        the next

    - #### getPrevious

          public java.util.Iterator<XBRLRelationship> getPrevious()

      Access to the [Preceding] property of the chain of relationships.
      Returns:
        the previous

    - #### setFrom

          public void setFrom(XMLFragment newFrom)
                       throws XBRLInconsistentDTSException

      sets the [From] property of this relationship
      Parameters:
        `newFrom` - XMLFragment
      Throws:
        `XBRLInconsistentDTSException` - the XBRL inconsistent dts exception

    - #### setTo

          public void setTo(XMLFragment newTo)
                     throws XBRLInconsistentDTSException

      Sets the [To] property of this relationship.
      Parameters:
        `newTo` - XMLFragment
      Throws:
        `XBRLInconsistentDTSException` - the XBRL inconsistent dts exception

    - #### getUse

          public java.lang.Integer getUse()

      Access to the [Use] property. Values are either XBRLArc.OPTIONAL and XBRLArc.PROHIBITED.
      Returns:
        a constant integer parsed from the value of the use attribute on the arc.

    - #### getUse

          public static int getUse(java.lang.String code)

      Used to convert from string value of use to the integer value. "prohibited" is returned as XBRLArc.PROHIBITED constant and anything else is returned as XBRLArc.OPTIONAL
      Parameters:
        `code` - string value to convert to integer value
      Returns:
        the integer representing the use
      Since:
        2.6.5

    - #### getUse

          public static java.lang.String getUse(int useCode)

      Gets the use.
      Parameters:
        `useCode` - the use code
      Returns:
        the use

    - #### setUse

          public java.lang.Integer setUse(java.lang.Integer newValue)

      Sets the value of the [Use] property to XBRLArc.OPTIONAL or XBRLArc.PROHIBITED or reset the value if null is used
      Parameters:
        `newValue` - the new value
      Returns:
        old value
      Since:
        2.6.5

    - #### getPriority

          public int getPriority()

      Access to the [Priority] property.
      Returns:
        the priority

    - #### setPriority

          public java.lang.Integer setPriority(java.lang.Integer newValue)

      Sets the value of the [Priority] property or resets it if null is used as the new value.
      Parameters:
        `newValue` - as an Integer
      Returns:
        old value
      Since:
        2.6.5

    - #### getAttributes

          public java.util.Iterator<XBRLAttribute> getAttributes()

      Access to the [Attributes] property.
      Overrides:
        `getAttributes` in class `XMLFragment`
      Returns:
        Iterator
      See Also:
        `XMLFragment.getAllAttributes()`

    - #### getDTSBase

          public DTSBase getDTSBase()

      Returns the base property of this relationship.
      Returns:
        DTSBase

    - #### setDTSBase

          public void setDTSBase(DTSBase base)

      Sets the base property of this relationship.
      Parameters:
        `base` - the new DTS base

    - #### getOrder

          public java.lang.Double getOrder()

      Gets the order.
      Returns:
        Double

    - #### setOrder

          public java.lang.Double setOrder(java.lang.Double newValue)

      Set the value of the order attribute.
      Parameters:
        `newValue` - the new value
      Returns:
        Double, the old value of the order attribute
      Since:
        1.0

    - #### setChain

          public void setChain(XBRLRelationshipsChainLink chain)

      Sets the chain.
      Parameters:
        `chain` - the new chain

    - #### getChain

          public XBRLRelationshipsChainLink getChain()
                                              throws XBRLValidationException

      Gets the chain.
      Returns:
        the chain
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### 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` - the XBRL serialization exception

    - #### 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

    - #### 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.
      Returns:
        true, if successful

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