XBRLAPI

A Java API for XBRL


org.xbrlapi.impl
Class ArcImpl

java.lang.Object
  extended by org.xbrlapi.impl.XMLImpl
      extended by org.xbrlapi.impl.FragmentImpl
          extended by org.xbrlapi.impl.ExtendedLinkContentImpl
              extended by org.xbrlapi.impl.ArcImpl
All Implemented Interfaces:
Serializable, Comparable<XML>, Arc, ExtendedLinkContent, Fragment, Xlink, XML

public class ArcImpl
extends ExtendedLinkContentImpl
implements Arc

Used for all extended link arcs.

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

Field Summary
 
Fields inherited from class org.xbrlapi.impl.XMLImpl
logger
 
Constructor Summary
ArcImpl()
           
 
Method Summary
 String getActuate()
          Get the xlink:actuate attribute value.
 URI getArcrole()
           
 String getAttribute(String name)
          Get a no-namespace attribute value.
 String getAttribute(URI namespace, String name)
          Get a non-xlink attribute value.
 ExtendedLink getExtendedLink()
          Get the extended link containing the extended link xlink content.
 String getFrom()
          Get the xlink:from attribute value.
 Double getOrder()
          Get the order attribute value.
 URI getPreferredLabelRole()
          This method is useful in the context of parent-child presentation relationships as defined in the XBRL 2.1 specification.
 Integer getPriority()
           
 NamedNodeMap getSemanticAttributes()
          TODO Add in PSVI information re default and fixed attribute values.
 String getSemanticKey()
           
 String getShow()
          Get the xlink:show attribute value.
<E extends ArcEnd>
List<E>
getSourceFragments()
          Get the list of ArcEnd fragments that the arc runs from.
protected  URI getTargetDocumentURI(URI uri)
          Get the URI of the document containing the fragment targetted by the supplied URI.
<E extends ArcEnd>
List<E>
getTargetFragments()
          Get the list of ArcEnd fragments that the arc runs to.
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 specific title fragment
 List<Title> getTitleElements()
          Get a list of titles (The xlink:title children elements).
 String getTo()
          Get the xlink:to attribute value.
 String getUse()
           
 Double getWeight()
          This method is useful in the context of summation-item calculation relationships as defined in the XBRL 2.1 specification.
 String getXlinkType()
          Get the xlink type (The xxlink:type attribute value).
 boolean hasAttribute(String name)
           
 boolean hasAttribute(String namespace, String name)
           
 boolean isProhibited()
           
 boolean semanticEquals(Arc other)
          Returns true if this arc is semantically equal to the other arc.
 
Methods inherited from class org.xbrlapi.impl.FragmentImpl
appendElementSchemeXPointer, appendID, getAllChildren, getAllChildrenIndices, getAncestorOrSelf, getChild, getChildren, getChildren, getChildrenIndices, getDataRootElement, getElementSchemeXPointerExpression, getIDXPointerExpression, getLabels, getLabels, getLabelsWithLanguage, getLabelsWithLanguageAndResourceRole, getLabelsWithLanguageAndResourceRoleAndLinkRole, getLabelsWithResourceRole, 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, 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.Xlink
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, getLabelsWithLanguage, getLabelsWithLanguageAndResourceRole, getLabelsWithLanguageAndResourceRoleAndLinkRole, getLabelsWithResourceRole, 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, serialize, setBuilder, setIndex, setMetaAttribute, setResource, setStore, updateInStore
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

ArcImpl

public ArcImpl()
Method Detail

getAttribute

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

Specified by:
getAttribute in interface Arc
Specified by:
getAttribute in interface Xlink
Parameters:
namespace - The namespace of the attribute to retrieve
name - The local name of the attribute to retrieve
Returns:
the value of the attribute or null if the arc does not have the attribute.
Throws:
XBRLException - if the namespace URI is for the XLink namespace.
See Also:
Arc.getAttribute(URI,String)

hasAttribute

public boolean hasAttribute(String namespace,
                            String name)
                     throws XBRLException
Specified by:
hasAttribute in interface Arc
Parameters:
namespace - The namespace of the attribute
name - The local name of the attribute
Returns:
true if the arc has the attribute
Throws:
XBRLException
See Also:
Arc.hasAttribute(String,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 Arc
Specified by:
getAttribute in interface Xlink
Parameters:
name - The name of the no-namespace attribute to retrieve
Returns:
the value of the attribute or null if the arc does not have the attribute.
Throws:
XBRLException
See Also:
Arc.getAttribute(String)

hasAttribute

public boolean hasAttribute(String name)
                     throws XBRLException
Specified by:
hasAttribute in interface Arc
Parameters:
name - The name of the attribute
Returns:
true if the arc has the attribute
Throws:
XBRLException
See Also:
Arc.hasAttribute(String)

getExtendedLink

public ExtendedLink getExtendedLink()
                             throws XBRLException
Description copied from interface: ExtendedLinkContent
Get the extended link containing the extended link xlink content.

Specified by:
getExtendedLink in interface ExtendedLinkContent
Overrides:
getExtendedLink in class ExtendedLinkContentImpl
Returns:
the extended link fragment containing the extended link xlink content.
Throws:
XBRLException
See Also:
ExtendedLinkContent.getExtendedLink()

getShow

public String getShow()
               throws XBRLException
Description copied from interface: Arc
Get the xlink:show attribute value.

Specified by:
getShow in interface Arc
Returns:
the value of the xlink:show value or null if the attribute is not there.
Throws:
XBRLException
See Also:
Arc.getShow()

getActuate

public String getActuate()
                  throws XBRLException
Description copied from interface: Arc
Get the xlink:actuate attribute value.

Specified by:
getActuate in interface Arc
Returns:
the value of the xlink:actuate value or null if the attribute is not there.
Throws:
XBRLException
See Also:
Arc.getActuate()

getFrom

public String getFrom()
               throws XBRLException
Description copied from interface: Arc
Get the xlink:from attribute value.

Specified by:
getFrom in interface Arc
Returns:
the value of the xlink:from value or null if the attribute is not there.
Throws:
XBRLException
See Also:
Arc.getFrom()

getTo

public String getTo()
             throws XBRLException
Description copied from interface: Arc
Get the xlink:to attribute value.

Specified by:
getTo in interface Arc
Returns:
the value of the xlink:to value or null if the attribute is not there.
Throws:
XBRLException
See Also:
Arc.getTo()

getArcrole

public URI getArcrole()
               throws XBRLException
Specified by:
getArcrole in interface Arc
Returns:
the arc role of the arc.
Throws:
XBRLException
See Also:
Arc.getArcrole()

getOrder

public Double getOrder()
                throws XBRLException
Description copied from interface: Arc
Get the order attribute value.

Specified by:
getOrder in interface Arc
Returns:
the value of the order attribute or default value of 1 if none is provided.
Throws:
XBRLException
See Also:
Arc.getOrder()

getPriority

public Integer getPriority()
                    throws XBRLException
Specified by:
getPriority in interface Arc
Returns:
the relationship priority specified on the arc.
Throws:
XBRLException
See Also:
Arc.getPriority()

getUse

public String getUse()
              throws XBRLException
Specified by:
getUse in interface Arc
Returns:
the relationship use, "optional" or "prohibited", as specified on the arc.
Throws:
XBRLException
See Also:
Arc.getUse()

isProhibited

public boolean isProhibited()
                     throws XBRLException
Specified by:
isProhibited in interface Arc
Returns:
true if the arc has a use attribute equal to 'prohibited' and false otherwise.
Throws:
XBRLException
See Also:
Arc.isProhibited()

getSourceFragments

public <E extends ArcEnd> List<E> getSourceFragments()
                                          throws XBRLException
Description copied from interface: Arc
Get the list of ArcEnd fragments that the arc runs from.

Specified by:
getSourceFragments in interface Arc
Returns:
the list of ArcEnd fragment that the arc runs from.
Throws:
XBRLException
See Also:
Arc.getSourceFragments()

getTargetFragments

public <E extends ArcEnd> List<E> getTargetFragments()
                                          throws XBRLException
Description copied from interface: Arc
Get the list of ArcEnd fragments that the arc runs to.

Specified by:
getTargetFragments in interface Arc
Returns:
the list of ArcEnd fragment that the arc runs to.
Throws:
XBRLException
See Also:
Arc.getTargetFragments()

getSemanticAttributes

public NamedNodeMap getSemanticAttributes()
                                   throws XBRLException
TODO Add in PSVI information re default and fixed attribute values.

Specified by:
getSemanticAttributes in interface Arc
Returns:
a map of attribute nodes for semantic analysis.
Throws:
XBRLException
See Also:
Arc.getSemanticAttributes()

getSemanticKey

public String getSemanticKey()
                      throws XBRLException
Specified by:
getSemanticKey in interface Arc
Returns:
A string that is only equal for semantically equal arcs. The string reflects the names and values of the semantic attributes and provides that information in a consistent order.
Throws:
XBRLException
See Also:
Arc.getSemanticKey()

semanticEquals

public boolean semanticEquals(Arc other)
                       throws XBRLException
Description copied from interface: Arc
Returns true if this arc is semantically equal to the other arc. Semantic equality is defined such that two arcs can prohibit or override each-other only if they are semantically equal. This is a pre-requisite (but not the only) condition for prohibition and over-riding of XLink relationships.

Specified by:
semanticEquals in interface Arc
Parameters:
other - The other arc.
Returns:
true if and only if the two arcs are semantically equal.
Throws:
XBRLException
See Also:
Arc.semanticEquals(Arc)

getPreferredLabelRole

public URI getPreferredLabelRole()
                          throws XBRLException
Description copied from interface: Arc
This method is useful in the context of parent-child presentation relationships as defined in the XBRL 2.1 specification.

Specified by:
getPreferredLabelRole in interface Arc
Returns:
null if the relationship is not of the necessary type. Otherwise returns the value of the preferredLabel attribute if it is on the arc. Otherwise returns the standard label resource role Constants.StandardLabelRole
Throws:
XBRLException
See Also:
Arc.getPreferredLabelRole()

getWeight

public Double getWeight()
                 throws XBRLException
Description copied from interface: Arc
This method is useful in the context of summation-item calculation relationships as defined in the XBRL 2.1 specification.

Specified by:
getWeight in interface Arc
Returns:
the value of the weight attribute or null if the relationship is not of the necessary type.
Throws:
XBRLException
See Also:
Arc.getWeight()

getXlinkType

public String getXlinkType()
                    throws XBRLException
Get the xlink type (The xxlink:type attribute value).

Specified by:
getXlinkType in interface Xlink
Returns:
the value of the xlink:type attribute.
Throws:
XBRLException
See Also:
Xlink.getXlinkType()

getTitleAttribute

public String getTitleAttribute()
                         throws XBRLException
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
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
Get a specific title fragment

Specified by:
getTitleElement in interface Xlink
Parameters:
index - The index of the required title element
Returns:
the title fragment or null if there are no title children elements.
Throws:
XBRLException - if the index is out of bounds
See Also:
Xlink.getTitleElement(int)

getTargetDocumentURI

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

Parameters:
uri - The supplied URI for decomposition.
Returns:
The URI of the the document containing the fragment targetted 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. Fast, secure and Free Open Source software downloads