com.ihr.xbrl.mapper.instance

## Class MapperContextBase

- java.lang.Object
- - com.ihr.xbrl.om.XMLFragment
  - - com.ihr.xbrl.mapper.instance.MapperContextBase

- All Implemented Interfaces:
    HasAdditionalEqualityForReassignation, MapperContext, XBRLRelationshipPoint, Thinable, XMLHasParent, java.lang.Cloneable, javax.xml.namespace.NamespaceContext
  Direct Known Subclasses:
    MapperContext2, MapperContext3

      public abstract class MapperContextBase
      extends XMLFragment
      implements MapperContext

  The Class MapperContextBase.
  Author:
    Ignacio

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static javax.xml.namespace.QName` | `contextNode` The QName of the XML element that is the container of context information.

    - ### 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
    `MapperContextBase(DTSContainer dts, MapperBase parent, net.sf.saxon.s9api.XdmNode node)` Instantiates a new mapper context base.
    `MapperContextBase(MapperContextBase other)` Creates a new context as a copy or clone of the context supplied as a parameter The new context will have null as parent instance.
    `MapperContextBase(XBRLContext ctx, MapperBase parent)` Creates a new MapperContext from the content of an XBRLContext.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract MapperContextBase` | `clone()` Clone.
    `boolean` | `equals(java.lang.Object other)` Evaluates c-equality of two contexts according to the XBRL 2.1 spec The context IDs may be different and are not compared
    `void` | `fixUpSegmentAndScenario()` Fix up segment and scenario.
    `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
    `XBRLEntity` | `getEntity()` Gets the entity.
    `MapperBase` | `getMapper()` Gets the mapper.
    `MapperPeriod` | `getPeriod()` Gets the period.
    `XBRLScenario` | `getScenario()` Gets the scenario.
    `XBRLContext` | `getXBRLContext()` Gets the XBRL context.
    `int` | `hashCode()` Hash code.
    `void` | `setPeriod(MapperPeriod period)` Sets the new period for this context.
    `void` | `setScenario(XBRLScenario scenario)` Sets the new scenario for this context.

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

      `addAttribute, addChild, addFromRelationship, addNamespace, addNamespace, addToRelationship, addXMLChild, changeBase, checkBase, clear, clone, delAttribute, delAttribute, 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, 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`

    - ### Methods inherited from interface com.ihr.xbrl.mapper.instance.MapperContext

      `getContainer, getId, getOrGenerateId, setId`

- - ### Field Detail

    - #### contextNode

          public static final javax.xml.namespace.QName contextNode

      The QName of the XML element that is the container of context information.

  - ### Constructor Detail

    - #### MapperContextBase

          public MapperContextBase(XBRLContext ctx,
                           MapperBase parent)

      Creates a new MapperContext from the content of an XBRLContext.
      Parameters:
        `ctx` - the ctx
        `parent` - the parent

    - #### MapperContextBase

          public MapperContextBase(DTSContainer dts,
                           MapperBase parent,
                           net.sf.saxon.s9api.XdmNode node)

      Instantiates a new mapper context base.
      Parameters:
        `dts` - the DTS
        `parent` - the parent mapper
        `node` - the source node

    - #### MapperContextBase

          public MapperContextBase(MapperContextBase other)

      Creates a new context as a copy or clone of the context supplied as a parameter The new context will have null as parent instance.
      Parameters:
        `other` - the context to clone

  - ### Method Detail

    - #### clone

          public abstract MapperContextBase clone()

      Description copied from interface: `MapperContext`
      Clone.
      Specified by:
        `clone` in interface `MapperContext`
      Overrides:
        `clone` in class `XMLFragment`
      Returns:
        the mapper context

    - #### 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
      Specified by:
        `generateNode` in interface `MapperContext`
      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

    - #### hashCode

          public int hashCode()

      Description copied from interface: `MapperContext`
      Hash code.
      Specified by:
        `hashCode` in interface `MapperContext`
      Overrides:
        `hashCode` in class `XMLFragment`
      Returns:
        the int

    - #### equals

          public boolean equals(java.lang.Object other)

      Evaluates c-equality of two contexts according to the XBRL 2.1 spec The context IDs may be different and are not compared
      Specified by:
        `equals` in interface `MapperContext`
      Overrides:
        `equals` in class `XMLFragment`
      Parameters:
        `other` - the other
      Returns:
        true, if successful

    - #### getEntity

          public XBRLEntity getEntity()

      Gets the entity.
      Specified by:
        `getEntity` in interface `MapperContext`
      Returns:
        XBRLEntity

    - #### getXBRLContext

          public XBRLContext getXBRLContext()

      Gets the XBRL context.
      Specified by:
        `getXBRLContext` in interface `MapperContext`
      Returns:
        XBRLContext

    - #### getPeriod

          public MapperPeriod getPeriod()

      Gets the period.
      Specified by:
        `getPeriod` in interface `MapperContext`
      Returns:
        MapperPeriod

    - #### getScenario

          public XBRLScenario getScenario()

      Gets the scenario.
      Specified by:
        `getScenario` in interface `MapperContext`
      Returns:
        XBRLScenario

    - #### setScenario

          public void setScenario(XBRLScenario scenario)

      Sets the new scenario for this context.
      Specified by:
        `setScenario` in interface `MapperContext`
      Parameters:
        `scenario` - the new scenario

    - #### setPeriod

          public void setPeriod(MapperPeriod period)

      Sets the new period for this context.
      Specified by:
        `setPeriod` in interface `MapperContext`
      Parameters:
        `period` - the new period

    - #### getMapper

          public MapperBase getMapper()

      Gets the mapper.
      Specified by:
        `getMapper` in interface `MapperContext`
      Returns:
        Mapper

    - #### fixUpSegmentAndScenario

          public void fixUpSegmentAndScenario()

      Description copied from interface: `MapperContext`
      Fix up segment and scenario.
      Specified by:
        `fixUpSegmentAndScenario` in interface `MapperContext`