XBRLAPI

A Java API for XBRL


org.xbrlapi.impl
Class RelationshipImpl

java.lang.Object
  extended by org.xbrlapi.impl.XMLImpl
      extended by org.xbrlapi.impl.NonFragmentXMLImpl
          extended by org.xbrlapi.impl.RelationshipImpl
All Implemented Interfaces:
Serializable, Comparable<XML>, NonFragmentXML, Relationship, XML

public class RelationshipImpl
extends NonFragmentXMLImpl
implements Relationship

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

Field Summary
 
Fields inherited from class org.xbrlapi.impl.XMLImpl
logger
 
Constructor Summary
RelationshipImpl()
          No argument constructor.
RelationshipImpl(Arc arc, Fragment source, Fragment target)
           
 
Method Summary
 Arc getArc()
           
 String getArcAttributeValue(String name)
          Use this method if the attribute on the arc does not have its own namespace.
 String getArcAttributeValue(URI namespace, String name)
          Use this method if the attribute on the arc has its own namespace.
 String getArcIndex()
           
 String getArcName()
           
 URI getArcNamespace()
           
 Double getArcOrder()
           
 Integer getArcPriority()
           
 URI getArcrole()
           
 URI getArcURI()
           
 ExtendedLink getExtendedLink()
           
 String getLinkIndex()
           
 String getLinkName()
           
 URI getLinkNamespace()
           
 URI getLinkRole()
           
 String getSignature()
           
<F extends Fragment>
F
getSource()
           
 String getSourceIndex()
           
 String getSourceLanguageCode()
           
 String getSourceName()
           
 URI getSourceNamespace()
           
 URI getSourceRole()
           
 String getSourceType()
           
 URI getSourceURI()
           
<F extends Fragment>
F
getTarget()
           
 String getTargetIndex()
           
 String getTargetLanguageCode()
           
 String getTargetName()
           
 URI getTargetNamespace()
           
 URI getTargetRole()
           
 String getTargetType()
           
 URI getTargetURI()
           
 String getUse()
           
 boolean isFromRoot()
           
 boolean isProhibiting()
           
 boolean isToLabel()
           
 boolean isToReference()
           
 void setTargetNamespace(URI namespace)
           
 
Methods inherited from class org.xbrlapi.impl.NonFragmentXMLImpl
finalizeBuilder
 
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.Relationship
toString
 
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

RelationshipImpl

public RelationshipImpl()
                 throws XBRLException
No argument constructor.

Throws:
XBRLException

RelationshipImpl

public RelationshipImpl(Arc arc,
                        Fragment source,
                        Fragment target)
                 throws XBRLException
Parameters:
arc - The arc defining the relationship
source - The source of the relationship
target - The target of the relationship
Throws:
XBRLException
Method Detail

getArc

public Arc getArc()
           throws XBRLException
Specified by:
getArc in interface Relationship
Returns:
the arc fragment defining the relationship.
Throws:
XBRLException
See Also:
Relationship.getArc()

getArcIndex

public String getArcIndex()
Specified by:
getArcIndex in interface Relationship
Returns:
the arc fragment index.
See Also:
Relationship.getArcIndex()

getArcURI

public URI getArcURI()
              throws XBRLException
Specified by:
getArcURI in interface Relationship
Returns:
the URI of the document containing the arc defining this persisted relationship.
Throws:
XBRLException - if the URI is malformed
See Also:
Relationship.getArcURI()

getSourceURI

public URI getSourceURI()
                 throws XBRLException
Specified by:
getSourceURI in interface Relationship
Returns:
the URI of the document containing the source of the relationship.
Throws:
XBRLException - if the URI is malformed or if the relationship has not been initialised with the source URI.
See Also:
Relationship.getSourceURI()

getTargetURI

public URI getTargetURI()
                 throws XBRLException
Specified by:
getTargetURI in interface Relationship
Returns:
the URI of the document containing the target of the relationship.
Throws:
XBRLException - if the URI is malformed or if the relationship has not been initialised with the target URI.
See Also:
Relationship.getTargetURI()

getArcName

public String getArcName()
Specified by:
getArcName in interface Relationship
Returns:
the arc element name.
See Also:
Relationship.getArcName()

getArcNamespace

public URI getArcNamespace()
Specified by:
getArcNamespace in interface Relationship
Returns:
the arc element namespace.
See Also:
Relationship.getArcNamespace()

getArcrole

public URI getArcrole()
Specified by:
getArcrole in interface Relationship
Returns:
the XLink arcrole of the relationship.
See Also:
Relationship.getArcrole()

getArcOrder

public Double getArcOrder()
Specified by:
getArcOrder in interface Relationship
Returns:
the XLink arc order for the relationship.
See Also:
Relationship.getArcOrder()

getArcPriority

public Integer getArcPriority()
Specified by:
getArcPriority in interface Relationship
Returns:
the arc priority for the relationship.
See Also:
Relationship.getArcPriority()

getUse

public String getUse()
Specified by:
getUse in interface Relationship
Returns:
the arc use for the relationship.
See Also:
Relationship.getUse()

getLinkName

public String getLinkName()
Specified by:
getLinkName in interface Relationship
Returns:
the link element name.
See Also:
Relationship.getLinkName()

getLinkNamespace

public URI getLinkNamespace()
Specified by:
getLinkNamespace in interface Relationship
Returns:
the link element namespace.
See Also:
Relationship.getLinkNamespace()

getLinkRole

public URI getLinkRole()
Specified by:
getLinkRole in interface Relationship
Returns:
the XLink link role of the relationship.
See Also:
Relationship.getLinkRole()

getSource

public <F extends Fragment> F getSource()
                             throws XBRLException
Specified by:
getSource in interface Relationship
Returns:
the source fragment of the relationship.
Throws:
XBRLException
See Also:
Relationship.getSource()

getSourceIndex

public String getSourceIndex()
Specified by:
getSourceIndex in interface Relationship
Returns:
the fragment index for the source of the relationship.
See Also:
Relationship.getSourceIndex()

getSourceLanguageCode

public String getSourceLanguageCode()
Specified by:
getSourceLanguageCode in interface Relationship
Returns:
the source XML language code or null if none exists.
See Also:
Relationship.getSourceLanguageCode()

getSourceRole

public URI getSourceRole()
Specified by:
getSourceRole in interface Relationship
Returns:
the source XLink role or null if none exists.
See Also:
Relationship.getSourceRole()

getSourceType

public String getSourceType()
Specified by:
getSourceType in interface Relationship
Returns:
the type of the source fragment.
See Also:
Relationship.getSourceType()

getSourceName

public String getSourceName()
Specified by:
getSourceName in interface Relationship
Returns:
the source element name.
See Also:
Relationship.getSourceName()

getSourceNamespace

public URI getSourceNamespace()
Specified by:
getSourceNamespace in interface Relationship
Returns:
the source element namespace.
See Also:
Relationship.getSourceNamespace()

getTarget

public <F extends Fragment> F getTarget()
                             throws XBRLException
Specified by:
getTarget in interface Relationship
Returns:
the target fragment of the relationship.
Throws:
XBRLException
See Also:
Relationship.getTarget()

getTargetIndex

public String getTargetIndex()
Specified by:
getTargetIndex in interface Relationship
Returns:
the fragment index for the target of the relationship.
See Also:
Relationship.getTargetIndex()

getTargetLanguageCode

public String getTargetLanguageCode()
Specified by:
getTargetLanguageCode in interface Relationship
Returns:
the target XML language code or null if none exists.
See Also:
Relationship.getTargetLanguageCode()

getTargetRole

public URI getTargetRole()
Specified by:
getTargetRole in interface Relationship
Returns:
the target XLink role or null if none exists.
See Also:
Relationship.getTargetRole()

getSignature

public String getSignature()
Specified by:
getSignature in interface Relationship
Returns:
the relationship signature which is what is used to match up relationships that override or prohibit one another.
See Also:
Relationship.getSignature()

getTargetType

public String getTargetType()
Specified by:
getTargetType in interface Relationship
Returns:
the type of the target fragment.
See Also:
Relationship.getTargetType()

getTargetName

public String getTargetName()
Specified by:
getTargetName in interface Relationship
Returns:
the target element name.
See Also:
Relationship.getTargetName()

getTargetNamespace

public URI getTargetNamespace()
Specified by:
getTargetNamespace in interface Relationship
Returns:
the target element namespace.
See Also:
Relationship.getTargetNamespace()

setTargetNamespace

public void setTargetNamespace(URI namespace)
                        throws XBRLException
Parameters:
namespace - The namespace of the target element.
Throws:
XBRLException

isToLabel

public boolean isToLabel()
Specified by:
isToLabel in interface Relationship
Returns:
true if the relationship is to an XBRL 2.1 or generic label
See Also:
Relationship.isToLabel()

isToReference

public boolean isToReference()
Specified by:
isToReference in interface Relationship
Returns:
true if the relationship is to an XBRL 2.1 or generic reference
See Also:
Relationship.isToReference()

isFromRoot

public boolean isFromRoot()
                   throws XBRLException
Specified by:
isFromRoot in interface Relationship
Returns:
true if the relationship is from a source fragment that is not also a target fragment in the same network of relationships that this relationship participates in. Returns false otherwise.
Throws:
XBRLException
See Also:
Relationship.isFromRoot()

getArcAttributeValue

public String getArcAttributeValue(URI namespace,
                                   String name)
                            throws XBRLException
Description copied from interface: Relationship
Use this method if the attribute on the arc has its own namespace.

Specified by:
getArcAttributeValue in interface Relationship
Parameters:
namespace - The namespace of the attribute.
name - The local name of the attribute.
Returns:
The value of the attribute on the arc or null if no such attribute exists.
Throws:
XBRLException
See Also:
Relationship.getArcAttributeValue(URI, String)

getArcAttributeValue

public String getArcAttributeValue(String name)
                            throws XBRLException
Description copied from interface: Relationship
Use this method if the attribute on the arc does not have its own namespace.

Specified by:
getArcAttributeValue in interface Relationship
Parameters:
name - The name of the attribute.
Returns:
The value of the attribute on the arc or null if no such attribute exists.
Throws:
XBRLException
See Also:
Relationship.getArcAttributeValue(java.lang.String)

getExtendedLink

public ExtendedLink getExtendedLink()
                             throws XBRLException
Specified by:
getExtendedLink in interface Relationship
Returns:
the extended link that contains the arc defining the relationship.
Throws:
XBRLException
See Also:
Relationship.getExtendedLink()

getLinkIndex

public String getLinkIndex()
                    throws XBRLException
Specified by:
getLinkIndex in interface Relationship
Returns:
the index of the containing extended link.
Throws:
XBRLException
See Also:
Relationship.getLinkIndex()

isProhibiting

public boolean isProhibiting()
                      throws XBRLException
Specified by:
isProhibiting in interface Relationship
Returns:
true if the relationship has prohibited use and false otherwise. Note that this does not test if this relationship is prohibited by another relationship with a higher priority.
Throws:
XBRLException
See Also:
Relationship.isProhibiting()

Get Java XBRL API implementation at SourceForge.net.