XBRLAPI

A Java API for XBRL


org.xbrlapi.impl
Class FragmentImpl

java.lang.Object
  extended by org.xbrlapi.impl.XMLImpl
      extended by org.xbrlapi.impl.FragmentImpl
All Implemented Interfaces:
Serializable, Comparable<XML>, Fragment, XML
Direct Known Subclasses:
ContextComponentImpl, CustomTypeImpl, ExtendedLinkContentImpl, FactDimensionContainerImpl, FactImpl, InstanceImpl, LanguageImpl, LinkbaseImpl, LinkImpl, MockImpl, ReferencePartImpl, SchemaContentImpl, TitleImpl, UsedOnImpl, XlinkDocumentationImpl

public class FragmentImpl
extends XMLImpl
implements Fragment

Implements the functionality that is common to all types of XBRL fragments.

Author:
Geoffrey Shuetrim (geoff@galexy.net)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xbrlapi.impl.XMLImpl
logger
 
Constructor Summary
FragmentImpl()
           
 
Method Summary
 void appendElementSchemeXPointer(String expression)
          Add an element Scheme XPointer Expression to the metadata.
 void appendID(String id)
          Add an ID (used in XPointer resolution) to the metadata.
 List<Fragment> getAllChildren()
          Gets all child fragments.
 Set<String> getAllChildrenIndices()
           
 Fragment getAncestorOrSelf(String type)
          Gets the ancestor (or self) fragment with the specified fragment type.
 Fragment getChild(String type, int index)
          Get a specific child fragment.
<F extends Fragment>
List<F>
getChildren(Class<?> requiredClass)
          Gets the child fragments with the specified fragment type.
<F extends Fragment>
List<F>
getChildren(String type)
          Gets the child fragments with the specified fragment type.
 Set<String> getChildrenIndices(String type)
           
 Element getDataRootElement()
          Get the root element of the fragment data.
 String getElementSchemeXPointerExpression()
           
 String getIDXPointerExpression()
           
 List<LabelResource> getLabels()
           
 List<LabelResource> getLabels(List<String> languages, List<URI> resourceRoles)
           
 List<LabelResource> getLabels(List<String> languages, List<URI> labelRoles, List<URI> linkRoles)
           
 List<LabelResource> getLabelsWithLanguage(String language)
           
 List<LabelResource> getLabelsWithLanguageAndResourceRole(String language, URI role)
           
 List<LabelResource> getLabelsWithLanguageAndResourceRoleAndLinkRole(String language, URI resourceRole, URI linkRole)
           
 List<LabelResource> getLabelsWithResourceRole(URI role)
           
 String getLanguage()
           
 String getLanguage(Node node)
          Algorithm is as follows: If the node is an attribute, redo with the parent node. If the node is a XBRLAPI metadata element redo with right node in parent fragment. If the node is an element in the fragment data: Try to find the XML lang attribute and use its value. If that fails, redo the search using the parent node.
 String getLanguageName(List<String> languages)
           
 String getLanguageName(String language)
           
 String getLocalname()
          Get the local name of the fragment's root element
 String getLocalnameFromQName(String qname)
          Returns the local name for a QName
 URI getNamespace()
          Get the namespace of the fragment root element.
 URI getNamespaceFromQName(String qname, Node node)
          Algorithm is as follows: If the node is an attribute, redo with the parent node. If the node is a XBRLAPI metadata element redo with right node in parent fragment. If the node is an element in the fragment data: Generate namespace declaration attribute name - 'xmlns:...' to search for. Try to match the QName prefix to the element's prefix to see if the element namespace is appropriate to return. Try to find the attribute doing the namespace declaration on the element and use that. If that fails, redo the search using the parent node.
 Fragment getParent()
          Get the parent fragment of this fragment or null if there is none.
 Element getParentElement(Element parentDataRootElement)
          This method operates as follows: If the sequence to the parent element indicates that the data root element is the parent - use that. Loop through the sequence to the parent element.
 String getParentIndex()
          Get the index of the parent fragment or null if the fragment does not have a parent fragment.
 String getPrefixFromQName(String qname)
          Returns the Namespace prefix for a QName
 List<ReferenceResource> getReferences()
           
 List<ReferenceResource> getReferencesWithLanguage(String language)
           
 List<ReferenceResource> getReferencesWithLanguageAndResourceRoleAndLinkRole(String language, URI resourceRole, URI linkRole)
           
 List<ReferenceResource> getReferencesWithLanguageAndRole(String language, URI role)
           
 List<ReferenceResource> getReferencesWithResourceRole(String role)
           
 List<Locator> getReferencingLocators()
          Retrieves a list of all locators that target this fragment.
 String[] getSequenceToParentElement()
          Get the sequence of steps through the parent fragment DOM to the parent element.
 String getSequenceToParentElementAsString()
           
 List<SimpleLink> getSimpleLinks()
           
 URI getURI()
          Get the URI of the document containing this fragment.
 String getXPath()
          Get the XPath to the element in the parent fragment that is the parent element of this fragment's root element.
 String getXPointerExpression()
           
 boolean isAncestorOf(Fragment descendant)
           
 boolean isChild()
           
 boolean isNewFragment()
          Tests if a fragment is new in the sense that it does not have a root data element.
 boolean isRoot()
           
 void setParentIndex(String index)
          Set the index of the parent fragment.
 void setSequenceToParentElement(Fragment parent)
          Specifies the set of ancestor elements of the element in the parent fragment that is the insertion point for this fragment's root element.
 void setURI(URI uri)
          Set the URI of the fragment's document.
 
Methods inherited from class org.xbrlapi.impl.XMLImpl
appendMetadataElement, compareTo, equals, finalize, getBuilder, getDocumentNode, getIndex, getMetaAttribute, getMetadataRootElement, getStore, getType, hashCode, hasMetaAttribute, isa, isa, removeMetaAttribute, removeMetadataElement, serialize, serialize, serialize, setBuilder, setIndex, setMetaAttribute, setResource, setStore, updateInStore
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xbrlapi.XML
appendMetadataElement, equals, getBuilder, getDocumentNode, getIndex, getMetaAttribute, getMetadataRootElement, getStore, getType, hashCode, hasMetaAttribute, isa, isa, removeMetaAttribute, removeMetadataElement, serialize, serialize, serialize, setBuilder, setIndex, setMetaAttribute, setResource, setStore, updateInStore
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

FragmentImpl

public FragmentImpl()
Method Detail

getAncestorOrSelf

public Fragment getAncestorOrSelf(String type)
                           throws XBRLException
Description copied from interface: Fragment
Gets the ancestor (or self) fragment with the specified fragment type.

Specified by:
getAncestorOrSelf in interface Fragment
Parameters:
type - The required fragment type of the ancestor (or self).
Returns:
the first ancestor (or self) fragment that matches the specified fragment type working up the XML document structure from the supplied fragment to the root of the XML document. TODO Modify to use Generics so the fragment returned can be of a specific type.
Throws:
XBRLException - if no such ancestor fragment exists.
See Also:
Fragment.getAncestorOrSelf(String)

getChildren

public <F extends Fragment> List<F> getChildren(String type)
                                     throws XBRLException
Description copied from interface: Fragment
Gets the child fragments with the specified fragment type.

Specified by:
getChildren in interface Fragment
Parameters:
type - The required fragment type of the child. EG: If a list of org.xbrlapi.impl.ReferenceArcImpl fragments is required then this parameter would have a value of "ReferenceArc". Note that if the parameter contains full stops, then it is used directly as the value for the fragment type, enabling fragment extensions to exploit this method without placing fragment implementations in the org.xbrlapi package.
Returns:
the fragment list of children fragments that match the specified fragment type
Throws:
XBRLException
See Also:
Fragment.getChildren(String)

getChildren

public <F extends Fragment> List<F> getChildren(Class<?> requiredClass)
                                     throws XBRLException
Description copied from interface: Fragment
Gets the child fragments with the specified fragment type.

Specified by:
getChildren in interface Fragment
Parameters:
requiredClass - The required fragment class of the child fragments.
Returns:
the fragment list of children fragments that match the specified fragment type
Throws:
XBRLException
See Also:
Fragment.getChildren(Class)

getChildrenIndices

public Set<String> getChildrenIndices(String type)
                               throws XBRLException
Specified by:
getChildrenIndices in interface Fragment
Parameters:
type - The fragment type
Returns:
The list of all fragments of the given fragment type.
Throws:
XBRLException
See Also:
Fragment.getChildrenIndices(String)

getSimpleLinks

public List<SimpleLink> getSimpleLinks()
                                throws XBRLException
Specified by:
getSimpleLinks in interface Fragment
Returns:
the list of simple links that are children of this fragment.
Throws:
XBRLException
See Also:
Fragment.getSimpleLinks()

getAllChildren

public List<Fragment> getAllChildren()
                              throws XBRLException
Description copied from interface: Fragment
Gets all child fragments.

Specified by:
getAllChildren in interface Fragment
Returns:
the fragment list of children fragments or the empty list if no child fragments exist in the data store.
Throws:
XBRLException
See Also:
Fragment.getAllChildren()

getAllChildrenIndices

public Set<String> getAllChildrenIndices()
                                  throws XBRLException
Specified by:
getAllChildrenIndices in interface Fragment
Returns:
the set of indices of all child fragments of this fragment.
Throws:
XBRLException
See Also:
Fragment.getAllChildrenIndices()

getChild

public Fragment getChild(String type,
                         int index)
                  throws XBRLException
Description copied from interface: Fragment
Get a specific child fragment.

Specified by:
getChild in interface Fragment
Parameters:
type - The fragment type of the required child
index - The index of the required child fragment (among other children of the same type) with the first child being at index 0.
Returns:
the child fragment or null if there are no children fragments of the specified type.
Throws:
XBRLException - if the index is out of bounds
See Also:
Fragment.getChild(String, int)

getDataRootElement

public Element getDataRootElement()
                           throws XBRLException
Description copied from interface: Fragment
Get the root element of the fragment data.

Specified by:
getDataRootElement in interface Fragment
Returns:
an XML Element that is the root of the fragment data.
Throws:
XBRLException - if the fragment does not have fragment data.
See Also:
Fragment.getDataRootElement()

isNewFragment

public boolean isNewFragment()
                      throws XBRLException
Description copied from interface: Fragment
Tests if a fragment is new in the sense that it does not have a root data element. This is only used by the SAX content builder to keep track of where the fragment construction process is at.

Specified by:
isNewFragment in interface Fragment
Returns:
true if the fragment is new.
Throws:
XBRLException
See Also:
Fragment.isNewFragment()

getURI

public URI getURI()
           throws XBRLException
Description copied from interface: Fragment
Get the URI of the document containing this fragment.

Specified by:
getURI in interface Fragment
Throws:
XBRLException
See Also:
Fragment.getURI()

setURI

public void setURI(URI uri)
            throws XBRLException
Description copied from interface: Fragment
Set the URI of the fragment's document.

Specified by:
setURI in interface Fragment
Parameters:
uri - The string value of the document's absolute URI
Throws:
XBRLException
See Also:
Fragment.setURI(URI)

getReferencingLocators

public List<Locator> getReferencingLocators()
                                     throws XBRLException
Description copied from interface: Fragment
Retrieves a list of all locators that target this fragment.

Specified by:
getReferencingLocators in interface Fragment
Returns:
a list of all locators that target this fragment. The list can be empty.
Throws:
XBRLException
See Also:
Fragment.getReferencingLocators()

getLabels

public List<LabelResource> getLabels()
                              throws XBRLException
Specified by:
getLabels in interface Fragment
Returns:
a list of label resources for the fragment.
Throws:
XBRLException
See Also:
Fragment.getLabels()

getLabelsWithResourceRole

public List<LabelResource> getLabelsWithResourceRole(URI role)
                                              throws XBRLException
Specified by:
getLabelsWithResourceRole in interface Fragment
Parameters:
role - The XLink role value
Returns:
the list of labels for this fragment with the specified XLink role.
Throws:
XBRLException
See Also:
Fragment.getLabelsWithResourceRole(URI)

getLabels

public List<LabelResource> getLabels(List<String> languages,
                                     List<URI> resourceRoles)
                              throws XBRLException
Specified by:
getLabels in interface Fragment
Parameters:
languages - the list of language codes in order of preference from most preferred to least preferred, eventually allowing any language if no explicit preference match.
resourceRoles - the list of label resource roles in order of preference from most preferred to least preferred, eventually allowing any resource role.
Returns:
the list of labels that best match the specified search criteria. Note that a label role preference which takes precedence over a language preference.
Throws:
XBRLException
See Also:
Fragment.getLabels(List, List)

getLabels

public List<LabelResource> getLabels(List<String> languages,
                                     List<URI> labelRoles,
                                     List<URI> linkRoles)
                              throws XBRLException
Specified by:
getLabels in interface Fragment
Parameters:
languages - the list of language codes in order of preference from most preferred to least preferred, eventually allowing any language if no explicit preference match.
labelRoles - the list of label resource roles in order of preference from most preferred to least preferred, eventually allowing any resource role.
linkRoles - the list of extended link roles in order of preference from most preferred to least preferred, eventually allowing any link role.
Returns:
the list of labels that best match the specified search criteria. Note that a link role preference takes precedence over a label role preference which takes precedence over a language preference. Note also that if none of the preferences are met, an attempt is still made to return a list of all labels in the data store for this fragment.
Throws:
XBRLException
See Also:
Fragment.getLabels(List, List, List)

getReferencesWithResourceRole

public List<ReferenceResource> getReferencesWithResourceRole(String role)
                                                      throws XBRLException
Specified by:
getReferencesWithResourceRole in interface Fragment
Parameters:
role - The XLink role value
Returns:
the list of references for this fragment with the specified XLink role.
Throws:
XBRLException
See Also:
Fragment.getReferencesWithResourceRole(String)

getLabelsWithLanguage

public List<LabelResource> getLabelsWithLanguage(String language)
                                          throws XBRLException
Specified by:
getLabelsWithLanguage in interface Fragment
Parameters:
language - The xml:lang language codevalue
Returns:
the list of labels for this fragment with the specified language code.
Throws:
XBRLException
See Also:
Fragment.getLabelsWithLanguage(String)

getLabelsWithLanguageAndResourceRole

public List<LabelResource> getLabelsWithLanguageAndResourceRole(String language,
                                                                URI role)
                                                         throws XBRLException
Specified by:
getLabelsWithLanguageAndResourceRole in interface Fragment
Parameters:
language - The xml:lang language code value
role - The XLink role value
Returns:
the list of labels for this fragment with the specified language code and XLink role.
Throws:
XBRLException
See Also:
Fragment.getLabelsWithLanguageAndResourceRole(String, URI)

getLabelsWithLanguageAndResourceRoleAndLinkRole

public List<LabelResource> getLabelsWithLanguageAndResourceRoleAndLinkRole(String language,
                                                                           URI resourceRole,
                                                                           URI linkRole)
                                                                    throws XBRLException
Specified by:
getLabelsWithLanguageAndResourceRoleAndLinkRole in interface Fragment
Parameters:
language - The xml:lang language code value or null if not used as a a label selection criterion.
resourceRole - The XLink resource role value on the label or null if not used as a a label selection criterion.
linkRole - The XLink extended link role value on the extended link containing the label or null if not used as a a label selection criterion..
Returns:
the list of labels for this fragment that match the specified criteria.
Throws:
XBRLException
See Also:
Fragment.getLabelsWithLanguageAndResourceRole(String, URI)

getReferences

public List<ReferenceResource> getReferences()
                                      throws XBRLException
Specified by:
getReferences in interface Fragment
Returns:
a list of references for the fragment based on XBRL 2.1 reference arcs.
Throws:
XBRLException
See Also:
Fragment.getReferences()

getReferencesWithLanguage

public List<ReferenceResource> getReferencesWithLanguage(String language)
                                                  throws XBRLException
Specified by:
getReferencesWithLanguage in interface Fragment
Parameters:
language - The xml:lang language code value
Returns:
the list of references for this fragment with the specified language code.
Throws:
XBRLException
See Also:
Fragment.getReferencesWithLanguage(String)

getReferencesWithLanguageAndRole

public List<ReferenceResource> getReferencesWithLanguageAndRole(String language,
                                                                URI role)
                                                         throws XBRLException
Specified by:
getReferencesWithLanguageAndRole in interface Fragment
Parameters:
language - The xml:lang language code value
role - The XLink role value
Returns:
the list of references for this fragment with the specified language code and XLink role.
Throws:
XBRLException
See Also:
Fragment.getReferencesWithLanguageAndRole(String, URI)

getReferencesWithLanguageAndResourceRoleAndLinkRole

public List<ReferenceResource> getReferencesWithLanguageAndResourceRoleAndLinkRole(String language,
                                                                                   URI resourceRole,
                                                                                   URI linkRole)
                                                                            throws XBRLException
Specified by:
getReferencesWithLanguageAndResourceRoleAndLinkRole in interface Fragment
Parameters:
language - The xml:lang language code value
resourceRole - The XLink resource role value on the reference
linkRole - The XLink extended link role value on the extended link containing the reference.
Returns:
the list of references for this fragment with the specified language code and XLink resource and link roles.
Throws:
XBRLException
See Also:
Fragment.getReferencesWithLanguageAndResourceRoleAndLinkRole(String, URI, URI)

getParentIndex

public String getParentIndex()
                      throws XBRLException
Description copied from interface: Fragment
Get the index of the parent fragment or null if the fragment does not have a parent fragment.

Specified by:
getParentIndex in interface Fragment
Returns:
The index of the parent fragment or null if the fragment does not have a parent fragment.
Throws:
XBRLException - if the parent fragment index is not available.
See Also:
Fragment.getParentIndex()

isChild

public boolean isChild()
                throws XBRLException
Specified by:
isChild in interface Fragment
Returns:
true iff the fragment has a parent fragment and false otherwise.
Throws:
XBRLException
See Also:
Fragment.isChild()

isAncestorOf

public boolean isAncestorOf(Fragment descendant)
                     throws XBRLException
Specified by:
isAncestorOf in interface Fragment
Parameters:
descendant - The candidate descendant fragment.
Returns:
true if the candidate descendant is actually a descendant fragment and false otherwise.
Throws:
XBRLException
See Also:
Fragment.isAncestorOf(Fragment)

isRoot

public boolean isRoot()
               throws XBRLException
Specified by:
isRoot in interface Fragment
Returns:
true if the fragment is the root of an XML document and false otherwise.
Throws:
XBRLException
See Also:
Fragment.isRoot()

setParentIndex

public void setParentIndex(String index)
                    throws XBRLException
Description copied from interface: Fragment
Set the index of the parent fragment.

Specified by:
setParentIndex in interface Fragment
Parameters:
index - The index of the parent fragment.
Throws:
XBRLException - if the parent fragment index cannot be set.
See Also:
Fragment.setParentIndex(String)

getXPath

public String getXPath()
                throws XBRLException
Description copied from interface: Fragment
Get the XPath to the element in the parent fragment that is the parent element of this fragment's root element.

Specified by:
getXPath in interface Fragment
Returns:
The required xpath.
Throws:
XBRLException
See Also:
Fragment.getXPath()

setSequenceToParentElement

public void setSequenceToParentElement(Fragment parent)
                                throws XBRLException
Description copied from interface: Fragment
Specifies the set of ancestor elements of the element in the parent fragment that is the insertion point for this fragment's root element. The ancestor elements are identified by their sibling order in the parent fragment (after all other fragments have been carved out of it). Note that the root element of the parent fragment is not part of the sequence because that is always identified by a value of 1 - being an only child.

Specified by:
setSequenceToParentElement in interface Fragment
Parameters:
parent - The parent fragment.
Throws:
XBRLException
See Also:
Fragment.setSequenceToParentElement(Fragment)

getSequenceToParentElement

public String[] getSequenceToParentElement()
                                    throws XBRLException
Description copied from interface: Fragment
Get the sequence of steps through the parent fragment DOM to the parent element.

Specified by:
getSequenceToParentElement in interface Fragment
Returns:
The sequence through the parent fragment data to the parent element of this fragment.
Throws:
XBRLException
See Also:
Fragment.getSequenceToParentElement()

getSequenceToParentElementAsString

public String getSequenceToParentElementAsString()
                                          throws XBRLException
Specified by:
getSequenceToParentElementAsString in interface Fragment
Returns:
the sequence of steps through the parent fragment DOM to the parent element of this fragment.
Throws:
XBRLException
See Also:
Fragment.getSequenceToParentElementAsString()

appendID

public void appendID(String id)
              throws XBRLException
Description copied from interface: Fragment
Add an ID (used in XPointer resolution) to the metadata.

Specified by:
appendID in interface Fragment
Parameters:
id - The value of the ID.
Throws:
XBRLException
See Also:
TODO Eliminate the ID metadata element given the existence of the xptr elements.

appendElementSchemeXPointer

public void appendElementSchemeXPointer(String expression)
                                 throws XBRLException
Description copied from interface: Fragment
Add an element Scheme XPointer Expression to the metadata.

Specified by:
appendElementSchemeXPointer in interface Fragment
Parameters:
expression - The XPointer expression
Throws:
XBRLException
See Also:
Fragment.appendElementSchemeXPointer(String)

getNamespace

public URI getNamespace()
                 throws XBRLException
Description copied from interface: Fragment
Get the namespace of the fragment root element.

Specified by:
getNamespace in interface Fragment
Throws:
XBRLException - if there is no data element in the fragment.
See Also:
Fragment.getNamespace()

getLocalname

public String getLocalname()
                    throws XBRLException
Description copied from interface: Fragment
Get the local name of the fragment's root element

Specified by:
getLocalname in interface Fragment
Throws:
XBRLException
See Also:
Fragment.getLocalname()

getPrefixFromQName

public String getPrefixFromQName(String qname)
Description copied from interface: Fragment
Returns the Namespace prefix for a QName

Specified by:
getPrefixFromQName in interface Fragment
Parameters:
qname - The qName value to resolve
Returns:
the namespace prefix in the QName
See Also:
Fragment.getPrefixFromQName(String)

getNamespaceFromQName

public URI getNamespaceFromQName(String qname,
                                 Node node)
                          throws XBRLException
Algorithm is as follows:
  1. If the node is an attribute, redo with the parent node.
  2. If the node is a XBRLAPI metadata element redo with right node in parent fragment.
  3. If the node is an element in the fragment data:
    1. Generate namespace declaration attribute name - 'xmlns:...' to search for.
    2. Try to match the QName prefix to the element's prefix to see if the element namespace is appropriate to return.
    3. Try to find the attribute doing the namespace declaration on the element and use that.
    4. If that fails, redo the search using the parent node.

Specified by:
getNamespaceFromQName in interface Fragment
Parameters:
qname - The qName value to resolve
node - The node in the fragment data (as a DOM representation) to start QName resolution from.
Returns:
the namespace declared on the fragment for the QName
Throws:
XBRLException - if the namespace is not declared
See Also:
Fragment.getNamespaceFromQName(String, Node)

getLanguage

public String getLanguage(Node node)
                   throws XBRLException
Algorithm is as follows:
  1. If the node is an attribute, redo with the parent node.
  2. If the node is a XBRLAPI metadata element redo with right node in parent fragment.
  3. If the node is an element in the fragment data:
    1. Try to find the XML lang attribute and use its value.
    2. If that fails, redo the search using the parent node.

Specified by:
getLanguage in interface Fragment
Parameters:
node - The XML node to get the XML language fragment for.
Returns:
the value of the xml:lang attribute applying to the given node or null if no such attribute is applicable.
Throws:
XBRLException
See Also:
Fragment.getLanguage(Node)

getLanguage

public String getLanguage()
                   throws XBRLException
Specified by:
getLanguage in interface Fragment
Returns:
the value of the xml:lang attribute applying to the fragment root element or null if no such attribute is applicable. This takes into account xml:lang attribute inheritance though the XML heirarchy within an XML document.
Throws:
XBRLException
See Also:
Fragment.getLanguage(), Fragment.getLanguage(Node)

getLanguageName

public String getLanguageName(String language)
                       throws XBRLException
Specified by:
getLanguageName in interface Fragment
Parameters:
language - The language encoding of the language name, available in the data store in the form of a Language XML resource.
Returns:
the name of the language used for the fragment or null if none is specified or no appropriate Language resource is available in the data store.
Throws:
XBRLException
See Also:
Fragment.getLanguageName(String)

getLanguageName

public String getLanguageName(List<String> languages)
                       throws XBRLException
Specified by:
getLanguageName in interface Fragment
Returns:
the name of the language used for the fragment or null if none is specified or none is available. The name is obtained by working through the list of language encodings from first to last, returning the first name that is available in the data store in the form of a Language XML resource.
Throws:
XBRLException
See Also:
Fragment.getLanguageName(List)

getParent

public Fragment getParent()
                   throws XBRLException
Description copied from interface: Fragment
Get the parent fragment of this fragment or null if there is none.

Specified by:
getParent in interface Fragment
Returns:
the parent fragment or null if none exists.
Throws:
XBRLException
See Also:
Fragment.getParent()

getParentElement

public Element getParentElement(Element parentDataRootElement)
                         throws XBRLException
This method operates as follows:
  1. If the sequence to the parent element indicates that the data root element is the parent - use that.
  2. Loop through the sequence to the parent element.

Specified by:
getParentElement in interface Fragment
Parameters:
parentDataRootElement - The root element of the parent fragment's data.
Returns:
the element of the parent fragment that has this fragment as its child (or null if no parent exists).
Throws:
XBRLException
See Also:
Fragment.getParentElement(Element)

getLocalnameFromQName

public String getLocalnameFromQName(String qname)
Description copied from interface: Fragment
Returns the local name for a QName

Specified by:
getLocalnameFromQName in interface Fragment
Parameters:
qname - The qName value to resolve
Returns:
the local name for the QName.
See Also:
Fragment.getLocalnameFromQName(String)

getXPointerExpression

public String getXPointerExpression()
                             throws XBRLException
Specified by:
getXPointerExpression in interface Fragment
Returns:
the ID XPointer expression for this fragment or the element Scheme XPointer expression if there is no shorthand ID-based XPointer expression. What is returned is the entire string that is to be appended to the relevant URI to identify the fragment, including the # symbol and everything that follows it.
Throws:
XBRLException
See Also:
Fragment.getXPointerExpression()

getElementSchemeXPointerExpression

public String getElementSchemeXPointerExpression()
                                          throws XBRLException
Specified by:
getElementSchemeXPointerExpression in interface Fragment
Returns:
the element scheme XPointer expression for this fragment.
Throws:
XBRLException
See Also:
Fragment.getElementSchemeXPointerExpression()

getIDXPointerExpression

public String getIDXPointerExpression()
                               throws XBRLException
Specified by:
getIDXPointerExpression in interface Fragment
Returns:
the shorthand ID XPointer expression for this fragment or null if there is none.
Throws:
XBRLException
See Also:
Fragment.getIDXPointerExpression()

Get Java XBRL API implementation at SourceForge.net.