com.ihr.xbrl.om.exLinks

## Class XLinkElement

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

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, XBRLRelationshipPoint, Thinable, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
  Direct Known Subclasses:
    XBRLArc, XBRLExtendedLink, XBRLPointerOfARelationship, XBRLRelationship, XBRLSimpleLink

      public abstract class XLinkElement
      extends XMLFragment

  Base class for elements that contains attributes according to the XLink Specification.

  In release 2.6.5 of the API the local variables has been replaced by the content of the attributes hash table in the parent XMLFragment object in order to avoid double storage of values.

  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static javax.xml.namespace.QName` | `actuate` The Constant actuate.
    `static int` | `ACTUATE` The Constant ACTUATE.
    `static int` | `ARC` The Constant ARC.
    `static javax.xml.namespace.QName` | `arcrole` The Constant arcrole.
    `static int` | `ARCROLE` The Constant ARCROLE.
    `static int` | `ETITLE` The Constant ETITLE.
    `static int` | `EXTENDED` The Constant EXTENDED.
    `static javax.xml.namespace.QName` | `from` The Constant from.
    `static int` | `FROM` The Constant FROM.
    `static javax.xml.namespace.QName` | `href` The Constant href.
    `static int` | `HREF` The Constant HREF.
    `static javax.xml.namespace.QName` | `label` The Constant label.
    `static int` | `LABEL` The Constant LABEL.
    `static int` | `LOCATOR` The Constant LOCATOR.
    `static int` | `RESOURCE` The Constant RESOURCE.
    `static javax.xml.namespace.QName` | `role` The Constant role.
    `static int` | `ROLE` The Constant ROLE.
    `static javax.xml.namespace.QName` | `show` The Constant show.
    `static int` | `SHOW` The Constant SHOW.
    `static int` | `SIMPLE` The Constant SIMPLE.
    `static javax.xml.namespace.QName` | `title` The Constant title.
    `static int` | `TITLE` The Constant TITLE.
    `static javax.xml.namespace.QName` | `to` The Constant to.
    `static int` | `TO` The Constant TO.
    `static javax.xml.namespace.QName` | `type` The Constant type.
    `static int` | `TYPE` The Constant 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
    `XLinkElement(DTSContainer dts)` Creates an XLinkElement object for a DTS without assigning it to a node.
    `XLinkElement(DTSContainer dts, net.sf.saxon.s9api.XdmNode node)` Creates an XLinkElement object that exist in a DTS and assign it to a node returned by saxonica processor.
    `XLinkElement(XLinkElement other)` Creates an XLinkElement object by copying another XLinkElement object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.lang.String` | `getActuate()` Access to the value of the xlink:actuate property on simple link elements null is returned if the value is not set and there is no actuate attribute on the node.
    `java.lang.String` | `getArcrole()` Access to the value of the xlink:arcrole attribute on simple link elements.
    `java.lang.String` | `getFromTxt()` Access to the value of the xlink:from attibute on simple link elements (arcs only).
    `java.net.URI` | `getHRef()` Access to the value of the xlink:href attribute on simple link elements The value is not converted to an absolute URI in this function.
    `java.lang.String` | `getLabel()` Access to the value of the xlink:label attribute on simple link elements (only locator and resource elements) According to the XLink specification, label is optional on locators and resource elements.
    `java.lang.String` | `getRole()` Access to the content of the xlink:role attribute on the XLinkElement returns null if there is no xlink:role attribute on the element.
    `java.lang.String` | `getShow()` Access to the value of the xlink:show attribute on simple link elements, null is returned if the value is not set or there is no show attribute on the node .
    `static java.lang.String` | `getStaticLabel()` Creates a unique string to be used in xlink:label attributes.
    `java.lang.String` | `getSType()` Returns a string representation of the xlink:type attribute on simple links.
    `java.lang.String` | `getTitle()` Returns the value of the xlink:title attribute on simple link elements.
    `java.lang.String` | `getToTxt()` Access to the value of the xlink:to attribute on simple link elements (arcs only).
    `static boolean` | `isRequiredAttribute(int elementType, int attributeType)` Checks whether or not an attribute code is required for an xlink element.
    `static boolean` | `isValidAttribute(int elementType, int attributeType)` Checks whether or not an attribute code is valid in an xlink element.
    `void` | `setActuate(java.lang.String actuate)` Sets the value of the xlink:actuate attribute on simple link elements.
    `void` | `setArcrole(java.lang.String arcrole)` Sets the value of the xlink:arcrole attribute on simple link elements.
    `void` | `setFrom(java.lang.String from)` Sets the value of the xlink:from attribute on simple link elements (arcs only) since 2.6.5 setting this attribute updates all xlink:label attributes for existing elements in the source of the arc or the element that is the source of the relationship
    `void` | `setHRef(java.lang.String href)` Sets the value of the xlink:href attribute on simple link elements.
    `void` | `setLabel(java.lang.String label)` Sets the value of the xlink:label attribute on simple link elements starting with version 2.6.5 setting the value of the label here updates also the value of the xlink:from and xlink:to attributes on relationships.
    `void` | `setRole(java.lang.String role)` Sets the value of the xlink:role attribute to a specific value.
    `void` | `setShow(java.lang.String show)` Sets the value of the xlink:show attribute on simple link elements.
    `void` | `setSType(java.lang.String type)` Sets the value of the xlink:type attribute on simple links.
    `void` | `setTitle(java.lang.String title)` Sets the value for the xlink:title attribute.
    `void` | `setTo(java.lang.String to)` Sets the value of the xlink:to attribute on simple link elements (arcs only) since 2.6.5 setting this attribute updates all xlink:label attributes for existing elements in the target of the arc or the element that is the target of the relationship

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

      `addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clear, clone, clone, delAttribute, delAttribute, equals, equalXdmValues, evaluateBoolean, evaluateList, evaluateNode, evaluateNumber, evaluateString, generateId, generateNodeNamespacesAndAttributes, generateNodeValue, generatePrefix, getAllAttributes, getAttribute, getAttributeBooleanValue, getAttributeQNameValue, getAttributes, getAttributes, getAttributeStringValue, getAttributeValue, getBase, getBase, getBaseURI, getBooleanValue, getChild, getContainer, getContainerDocumentURI, getDeclaredNamespaces, getDocument, getElements, getElementsHashCode, getFragment, getFriendlyName, getFriendlyName, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getFromRelationships, getGenericLabelText, getId, getLang, getNamespaceURI, getNodeName, getNumberOfAttributes, getNumberOfElements, getNumberOfFromRelationships, getNumberOfToRelationships, getOrGenerateId, getParent, getPrefix, getPrefixes, getQNameValue, getRelationshipsBases, getRelationshipsChain, getRelationshipTypes, getStaticContext, getStaticNamespace, getStringValue, getToolTipText, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getToRelationships, getValue, getXPathExecutable, getXPathNamespaceContext, getXPathToNode, getXPathToRoot, getXPointerElementScheme, getXPointerElementScheme, getXPointerShorthandScheme, getXPointerToNode, hashCode, 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, setId, 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

    - #### LOCATOR

          public static final int LOCATOR

      The Constant LOCATOR.
      See Also:
        Constant Field Values

    - #### ARC

          public static final int ARC

      The Constant ARC.
      See Also:
        Constant Field Values

    - #### RESOURCE

          public static final int RESOURCE

      The Constant RESOURCE.
      See Also:
        Constant Field Values

    - #### EXTENDED

          public static final int EXTENDED

      The Constant EXTENDED.
      See Also:
        Constant Field Values

    - #### SIMPLE

          public static final int SIMPLE

      The Constant SIMPLE.
      See Also:
        Constant Field Values

    - #### ETITLE

          public static final int ETITLE

      The Constant ETITLE.
      See Also:
        Constant Field Values

    - #### TYPE

          public static final int TYPE

      The Constant TYPE.
      See Also:
        Constant Field Values

    - #### ROLE

          public static final int ROLE

      The Constant ROLE.
      See Also:
        Constant Field Values

    - #### ARCROLE

          public static final int ARCROLE

      The Constant ARCROLE.
      See Also:
        Constant Field Values

    - #### TITLE

          public static final int TITLE

      The Constant TITLE.
      See Also:
        Constant Field Values

    - #### SHOW

          public static final int SHOW

      The Constant SHOW.
      See Also:
        Constant Field Values

    - #### ACTUATE

          public static final int ACTUATE

      The Constant ACTUATE.
      See Also:
        Constant Field Values

    - #### LABEL

          public static final int LABEL

      The Constant LABEL.
      See Also:
        Constant Field Values

    - #### FROM

          public static final int FROM

      The Constant FROM.
      See Also:
        Constant Field Values

    - #### TO

          public static final int TO

      The Constant TO.
      See Also:
        Constant Field Values

    - #### HREF

          public static final int HREF

      The Constant HREF.
      See Also:
        Constant Field Values

    - #### type

          public static final javax.xml.namespace.QName type

      The Constant type.

    - #### role

          public static final javax.xml.namespace.QName role

      The Constant role.

    - #### arcrole

          public static final javax.xml.namespace.QName arcrole

      The Constant arcrole.

    - #### title

          public static final javax.xml.namespace.QName title

      The Constant title.

    - #### show

          public static final javax.xml.namespace.QName show

      The Constant show.

    - #### actuate

          public static final javax.xml.namespace.QName actuate

      The Constant actuate.

    - #### label

          public static final javax.xml.namespace.QName label

      The Constant label.

    - #### from

          public static final javax.xml.namespace.QName from

      The Constant from.

    - #### to

          public static final javax.xml.namespace.QName to

      The Constant to.

    - #### href

          public static final javax.xml.namespace.QName href

      The Constant href.

  - ### Constructor Detail

    - #### XLinkElement

          public XLinkElement(DTSContainer dts,
                      net.sf.saxon.s9api.XdmNode node)

      Creates an XLinkElement object that exist in a DTS and assign it to a node returned by saxonica processor.
      Parameters:
        `dts` - the dts
        `node` - the node, can be null

    - #### XLinkElement

          public XLinkElement(XLinkElement other)

      Creates an XLinkElement object by copying another XLinkElement object.
      Parameters:
        `other` - the other

    - #### XLinkElement

          public XLinkElement(DTSContainer dts)

      Creates an XLinkElement object for a DTS without assigning it to a node.
      Parameters:
        `dts` - the dts

  - ### Method Detail

    - #### isValidAttribute

          public static boolean isValidAttribute(int elementType,
                                 int attributeType)

      Checks whether or not an attribute code is valid in an xlink element.
      Parameters:
        `elementType` - the element type
        `attributeType` - the attribute type
      Returns:
        boolean

    - #### isRequiredAttribute

          public static boolean isRequiredAttribute(int elementType,
                                    int attributeType)

      Checks whether or not an attribute code is required for an xlink element.
      Parameters:
        `elementType` - the element type
        `attributeType` - the attribute type
      Returns:
        boolean

    - #### getTitle

          public final java.lang.String getTitle()
                                          throws XBRLRuntimeException

      Returns the value of the xlink:title attribute on simple link elements.
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setTitle

          public void setTitle(java.lang.String title)
                        throws XBRLValidationException

      Sets the value for the xlink:title attribute.
      Parameters:
        `title` - the new title
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getRole

          public final java.lang.String getRole()
                                         throws XBRLRuntimeException

      Access to the content of the xlink:role attribute on the XLinkElement returns null if there is no xlink:role attribute on the element.
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setRole

          public void setRole(java.lang.String role)
                       throws XBRLValidationException

      Sets the value of the xlink:role attribute to a specific value.
      Parameters:
        `role` - the new role
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getStaticLabel

          public static java.lang.String getStaticLabel()

      Creates a unique string to be used in xlink:label attributes.
      Returns:
        String

    - #### getLabel

          public final java.lang.String getLabel()
                                          throws XBRLRuntimeException

      Access to the value of the xlink:label attribute on simple link elements (only locator and resource elements) According to the XLink specification, label is optional on locators and resource elements.
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setLabel

          public void setLabel(java.lang.String label)
                        throws XBRLRuntimeException

      Sets the value of the xlink:label attribute on simple link elements

      starting with version 2.6.5 setting the value of the label here updates also the value of the xlink:from and xlink:to attributes on relationships.

      Parameters:
        `label` - the new label
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### getHRef

          public final java.net.URI getHRef()
                                     throws XBRLRuntimeException

      Access to the value of the xlink:href attribute on simple link elements The value is not converted to an absolute URI in this function.
      Returns:
        URI with the value of the xlink:href attribute
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setHRef

          public void setHRef(java.lang.String href)
                       throws XBRLValidationException

      Sets the value of the xlink:href attribute on simple link elements.
      Parameters:
        `href` - the new h ref
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getArcrole

          public final java.lang.String getArcrole()
                                            throws XBRLRuntimeException

      Access to the value of the xlink:arcrole attribute on simple link elements.
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setArcrole

          public void setArcrole(java.lang.String arcrole)
                          throws XBRLValidationException

      Sets the value of the xlink:arcrole attribute on simple link elements.
      Parameters:
        `arcrole` - the new arcrole
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getFromTxt

          public final java.lang.String getFromTxt()
                                            throws XBRLRuntimeException

      Access to the value of the xlink:from attibute on simple link elements (arcs only).
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setFrom

          public void setFrom(java.lang.String from)
                       throws XBRLValidationException

      Sets the value of the xlink:from attribute on simple link elements (arcs only)

      since 2.6.5 setting this attribute updates all xlink:label attributes for existing elements in the source of the arc or the element that is the source of the relationship

      Parameters:
        `from` - the new from
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getToTxt

          public final java.lang.String getToTxt()
                                          throws XBRLRuntimeException

      Access to the value of the xlink:to attribute on simple link elements (arcs only).
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setTo

          public void setTo(java.lang.String to)
                     throws XBRLValidationException

      Sets the value of the xlink:to attribute on simple link elements (arcs only)

      since 2.6.5 setting this attribute updates all xlink:label attributes for existing elements in the target of the arc or the element that is the target of the relationship

      Parameters:
        `to` - the new to
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getSType

          public final java.lang.String getSType()
                                          throws XBRLRuntimeException

      Returns a string representation of the xlink:type attribute on simple links. This is "locator" "arc" "resource" ... null would be returned if the value is not set or there is no xlink:type attribute on the node
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setSType

          public void setSType(java.lang.String type)
                        throws XBRLRuntimeException

      Sets the value of the xlink:type attribute on simple links.
      Parameters:
        `type` - the new s type
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### getShow

          public final java.lang.String getShow()
                                         throws XBRLRuntimeException

      Access to the value of the xlink:show attribute on simple link elements, null is returned if the value is not set or there is no show attribute on the node .
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setShow

          public void setShow(java.lang.String show)
                       throws XBRLValidationException

      Sets the value of the xlink:show attribute on simple link elements.
      Parameters:
        `show` - the new show
      Throws:
        `XBRLValidationException` - the XBRL validation exception

    - #### getActuate

          public final java.lang.String getActuate()
                                            throws XBRLRuntimeException

      Access to the value of the xlink:actuate property on simple link elements null is returned if the value is not set and there is no actuate attribute on the node.
      Returns:
        String
      Throws:
        `XBRLRuntimeException` - the XBRL runtime exception

    - #### setActuate

          public void setActuate(java.lang.String actuate)
                          throws XBRLValidationException

      Sets the value of the xlink:actuate attribute on simple link elements.
      Parameters:
        `actuate` - the new actuate
      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 `XMLFragment`
      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