XBRLAPI

A Java API for XBRL


org.xbrlapi.impl
Class ExtendedLinkImpl

java.lang.Object
  extended by org.xbrlapi.impl.XMLImpl
      extended by org.xbrlapi.impl.FragmentImpl
          extended by org.xbrlapi.impl.LinkImpl
              extended by org.xbrlapi.impl.ExtendedLinkImpl
All Implemented Interfaces:
Serializable, Comparable<XML>, ExtendedLink, Fragment, Link, Xlink, XML

public class ExtendedLinkImpl
extends LinkImpl
implements ExtendedLink

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

Field Summary
 
Fields inherited from class org.xbrlapi.impl.XMLImpl
logger
 
Constructor Summary
ExtendedLinkImpl()
           
 
Method Summary
 Map<String,List<String>> getArcEndIndicesByLabel()
           
<E extends ArcEnd>
List<E>
getArcEndsWithLabel(String label)
          Get the list of Arc Ends (locators or resources) with a specified label in the extended link.
 List<Arc> getArcs()
          Get the list of arcs contained by the extended link.
 List<Arc> getArcsWithArcrole(URI arcrole)
           
 List<Arc> getArcsWithFromLabel(String from)
           
 List<Arc> getArcsWithFromLabelAndArcrole(String from, URI arcrole)
           
 List<Arc> getArcsWithToLabel(String to)
           
 List<Arc> getArcsWithToLabelAndArcrole(String to, URI arcrole)
           
 String getAttribute(String name)
          Get a no-namespace attribute value.
 String getAttribute(URI namespace, String localname)
          Get a non-xlink attribute value.
 List<XlinkDocumentation> getDocumentations()
          Get the list of documentation fragments contained by the extended link.
 List<Locator> getLocators()
          Get the list of locators contained by the extended link.
 List<Locator> getLocatorsWithHref(String href)
          Get the list of locators in the extended link with a specified absolute HREF.
 List<Locator> getLocatorsWithLabel(String label)
          Get the list of locators with a specified label in the extended link.
 Map<String,String> getLocatorTargetIndices()
           
 List<Resource> getResources()
          Get the list of resources contained by the extended link.
 List<Resource> getResourcesWithLabel(String label)
          Get the list of resources with the specified label.
protected  URI getTargetDocumentURI(URI uri)
          Get the URI of the document containing the fragment targeted by the supplied URI.
protected  String getTargetPointerValue(String pointer)
          Get the value of the XPointer that corresponds to the XPointer information stored in the metadata of all fragments.
 String getTitleAttribute()
          Get the title (The xlink:title attribute value).
 Title getTitleElement(int index)
          Get a list of titles (The xlink:title children elements).
 List<Title> getTitleElements()
          Get a list of titles (The xlink:title children elements).
 String getXlinkType()
          Get the xlink type (The xxlink:type attribute value).
 
Methods inherited from class org.xbrlapi.impl.LinkImpl
getLinkRole
 
Methods inherited from class org.xbrlapi.impl.FragmentImpl
appendElementSchemeXPointer, appendID, getAllChildren, getAllChildrenIndices, getAncestorOrSelf, getChild, getChildren, getChildren, getChildrenIndices, getDataRootElement, getElementSchemeXPointerExpression, getIDXPointerExpression, getLabels, getLabels, getLabels, getLabelsWithLanguage, getLabelsWithLanguageAndResourceRole, getLabelsWithLanguageAndResourceRoleAndLinkRole, getLabelsWithResourceRole, getLanguage, getLanguage, getLanguageName, getLanguageName, getLocalname, getLocalnameFromQName, getNamespace, getNamespaceFromQName, getParent, getParentElement, getParentIndex, getPrefixFromQName, getReferences, getReferencesWithLanguage, getReferencesWithLanguageAndResourceRoleAndLinkRole, getReferencesWithLanguageAndRole, getReferencesWithResourceRole, getReferencingLocators, getSequenceToParentElement, getSequenceToParentElementAsString, getSimpleLinks, getURI, getXPath, getXPointerExpression, isAncestorOf, isChild, isNewFragment, isRoot, setParentIndex, setSequenceToParentElement, setURI
 
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.Link
getLinkRole
 
Methods inherited from interface org.xbrlapi.Xlink
getAttribute, getAttribute, getTitleAttribute, getTitleElement, getTitleElements, getXlinkType
 
Methods inherited from interface org.xbrlapi.Fragment
appendElementSchemeXPointer, appendID, getAllChildren, getAllChildrenIndices, getAncestorOrSelf, getChild, getChildren, getChildren, getChildrenIndices, getDataRootElement, getElementSchemeXPointerExpression, getIDXPointerExpression, getLabels, getLabels, getLabels, getLabelsWithLanguage, getLabelsWithLanguageAndResourceRole, getLabelsWithLanguageAndResourceRoleAndLinkRole, getLabelsWithResourceRole, getLanguage, getLanguage, getLanguageName, getLanguageName, getLocalname, getLocalnameFromQName, getNamespace, getNamespaceFromQName, getParent, getParentElement, getParentIndex, getPrefixFromQName, getReferences, getReferencesWithLanguage, getReferencesWithLanguageAndResourceRoleAndLinkRole, getReferencesWithLanguageAndRole, getReferencesWithResourceRole, getReferencingLocators, getSequenceToParentElement, getSequenceToParentElementAsString, getSimpleLinks, getURI, getXPath, getXPointerExpression, isAncestorOf, isChild, isNewFragment, isRoot, setParentIndex, setSequenceToParentElement, setURI
 
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

ExtendedLinkImpl

public ExtendedLinkImpl()
Method Detail

getLocators

public List<Locator> getLocators()
                          throws XBRLException
Description copied from interface: ExtendedLink
Get the list of locators contained by the extended link. Returns null if the extended link contains no locators.

Specified by:
getLocators in interface ExtendedLink
Throws:
XBRLException
See Also:
ExtendedLink.getLocators()

getArcEndsWithLabel

public <E extends ArcEnd> List<E> getArcEndsWithLabel(String label)
                                           throws XBRLException
Description copied from interface: ExtendedLink
Get the list of Arc Ends (locators or resources) with a specified label in the extended link.

Specified by:
getArcEndsWithLabel in interface ExtendedLink
Parameters:
label - The string value of the xlink:label attribute on the arc ends.
Returns:
the list of matching fragments or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getArcEndsWithLabel(String)

getLocatorsWithLabel

public List<Locator> getLocatorsWithLabel(String label)
                                   throws XBRLException
Description copied from interface: ExtendedLink
Get the list of locators with a specified label in the extended link.

Specified by:
getLocatorsWithLabel in interface ExtendedLink
Parameters:
label - The string value of the xlink:label attribute on the locator.
Returns:
the list of matching locator fragments or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getLocatorsWithLabel(String)

getLocatorsWithHref

public List<Locator> getLocatorsWithHref(String href)
                                  throws XBRLException
Description copied from interface: ExtendedLink
Get the list of locators in the extended link with a specified absolute HREF.

Specified by:
getLocatorsWithHref in interface ExtendedLink
Parameters:
href - The resolved value of the xlink:href attribute on the locator.
Returns:
the list of matching locator fragments or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getLocatorsWithHref(String)

getArcs

public List<Arc> getArcs()
                  throws XBRLException
Description copied from interface: ExtendedLink
Get the list of arcs contained by the extended link.

Specified by:
getArcs in interface ExtendedLink
Returns:
the list of matching arc fragments or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getArcs()

getArcsWithToLabel

public List<Arc> getArcsWithToLabel(String to)
                             throws XBRLException
Specified by:
getArcsWithToLabel in interface ExtendedLink
Parameters:
to - The required value of the xlink:to attribute of the arcs.
Returns:
the list of arcs with a given xlink:from label in extended link or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getArcsWithToLabel(String)

getArcsWithFromLabel

public List<Arc> getArcsWithFromLabel(String from)
                               throws XBRLException
Specified by:
getArcsWithFromLabel in interface ExtendedLink
Parameters:
from - The required value of the xlink:from attribute of the arcs.
Returns:
the list of arcs with a given xlink:from label in extended link. or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getArcsWithFromLabel(String)

getArcsWithFromLabelAndArcrole

public List<Arc> getArcsWithFromLabelAndArcrole(String from,
                                                URI arcrole)
                                         throws XBRLException
Specified by:
getArcsWithFromLabelAndArcrole in interface ExtendedLink
Parameters:
from - The required value of the xlink:from attribute of the arcs.
arcrole - The arcrole value for the arcs being sought.
Returns:
the list of arcs in the extended link starting at the given xlink label and arcrole value or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getArcsWithFromLabelAndArcrole(String,URI)

getArcsWithArcrole

public List<Arc> getArcsWithArcrole(URI arcrole)
                             throws XBRLException
Specified by:
getArcsWithArcrole in interface ExtendedLink
Parameters:
arcrole - The arcrole of the required arcs. Get the list of arcs with the given arcrole that are contained by the extended link.
Returns:
the list of matching arc fragments or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getArcsWithArcrole(URI)

getArcsWithToLabelAndArcrole

public List<Arc> getArcsWithToLabelAndArcrole(String to,
                                              URI arcrole)
                                       throws XBRLException
Specified by:
getArcsWithToLabelAndArcrole in interface ExtendedLink
Parameters:
to - The required value of the xlink:to attribute of the arcs.
arcrole - The arcrole value for the arcs being sought.
Returns:
the list of arcs in the extended link ending at the given xlink label and arcrole value or the empty list if none are found.
Throws:
XBRLException
See Also:
ExtendedLink.getArcsWithToLabelAndArcrole(String,URI)

getResources

public List<Resource> getResources()
                            throws XBRLException
Description copied from interface: ExtendedLink
Get the list of resources contained by the extended link.

Specified by:
getResources in interface ExtendedLink
Returns:
the list of resource fragments in the extended link.
Throws:
XBRLException
See Also:
ExtendedLink.getResources()

getResourcesWithLabel

public List<Resource> getResourcesWithLabel(String label)
                                     throws XBRLException
Description copied from interface: ExtendedLink
Get the list of resources with the specified label.

Specified by:
getResourcesWithLabel in interface ExtendedLink
Parameters:
label - The value of the label used to select resources in the extended link.
Returns:
the list of resource fragments with the given xlink:label attribute value.
Throws:
XBRLException
See Also:
ExtendedLink.getResourcesWithLabel(String)

getDocumentations

public List<XlinkDocumentation> getDocumentations()
                                           throws XBRLException
Get the list of documentation fragments contained by the extended link. Returns the list of documentation fragments in the extended link.

Specified by:
getDocumentations in interface ExtendedLink
Throws:
XBRLException
See Also:
ExtendedLink.getDocumentations()

getArcEndIndicesByLabel

public Map<String,List<String>> getArcEndIndicesByLabel()
                                                 throws XBRLException
Specified by:
getArcEndIndicesByLabel in interface ExtendedLink
Returns:
A map, indexed by XLink label, of the XLink arc end indices in an extended link.
Throws:
XBRLException
See Also:
ExtendedLink.getArcEndIndicesByLabel()

getLocatorTargetIndices

public Map<String,String> getLocatorTargetIndices()
                                           throws XBRLException
Specified by:
getLocatorTargetIndices in interface ExtendedLink
Returns:
a map of locator target indices indexed by the indices of the locators that target them.
Throws:
XBRLException
See Also:
ExtendedLink.getLocatorTargetIndices()

getXlinkType

public String getXlinkType()
                    throws XBRLException
Description copied from interface: Xlink
Get the xlink type (The xxlink:type attribute value). This is one of simple or extended

Specified by:
getXlinkType in interface Xlink
Throws:
XBRLException
See Also:
Xlink.getXlinkType()

getTitleAttribute

public String getTitleAttribute()
                         throws XBRLException
Description copied from interface: Xlink
Get the title (The xlink:title attribute value).

Specified by:
getTitleAttribute in interface Xlink
Returns:
the value of the xlink:title attribute or null if none is supplied.
Throws:
XBRLException
See Also:
Xlink.getTitleAttribute()

getTitleElements

public List<Title> getTitleElements()
                             throws XBRLException
Description copied from interface: Xlink
Get a list of titles (The xlink:title children elements).

Specified by:
getTitleElements in interface Xlink
Returns:
a fragment list of title elements or null if there are none.
Throws:
XBRLException
See Also:
Xlink.getTitleElements()

getTitleElement

public Title getTitleElement(int index)
                      throws XBRLException
Description copied from interface: Xlink
Get a list of titles (The xlink:title children elements). Returns null if there are no title children elements.

Specified by:
getTitleElement in interface Xlink
Parameters:
index - The index of the required title element
Returns:
The specified title fragment
Throws:
XBRLException
See Also:
Xlink.getTitleElement(int)

getAttribute

public String getAttribute(URI namespace,
                           String localname)
                    throws XBRLException
Description copied from interface: Xlink
Get a non-xlink attribute value.

Specified by:
getAttribute in interface Xlink
Parameters:
namespace - The namespace of the attribute to retrieve
localname - The local name of the attribute to retrieve
Throws:
XBRLException - if the namespace URI is for the XLink namespace.
See Also:
Xlink.getAttribute(URI, String)

getAttribute

public String getAttribute(String name)
                    throws XBRLException
Description copied from interface: Xlink
Get a no-namespace attribute value.

Specified by:
getAttribute in interface Xlink
Parameters:
name - The name of the no-namespace attribute to retrieve
Throws:
XBRLException
See Also:
Xlink.getAttribute(String)

getTargetDocumentURI

protected URI getTargetDocumentURI(URI uri)
                            throws XBRLException
Get the URI of the document containing the fragment targeted by the supplied URI.

Parameters:
uri - The supplied URI for decomposition.
Returns:
The URI of the the document containing the fragment targeted by the supplied URI.
Throws:
XBRLException

getTargetPointerValue

protected String getTargetPointerValue(String pointer)
                                throws XBRLException
Get the value of the XPointer that corresponds to the XPointer information stored in the metadata of all fragments.

Parameters:
pointer - The String value of the XPointer supplied in the URI.
Returns:
The value of the XPointer corresponding to the XPointer information stored in the metadata of all fragments. Returns the empty string if the XPointer does not specify an element scheme or ID based shorthand pointer value.
Throws:
XBRLException

Get Java XBRL API implementation at SourceForge.net.