⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arcendimpl.java

📁 xbrlapi的源码
💻 JAVA
字号:
package org.xbrlapi.impl;

import org.w3c.dom.Element;
import org.xbrlapi.Arc;
import org.xbrlapi.ArcEnd;
import org.xbrlapi.FragmentList;
import org.xbrlapi.utilities.Constants;
import org.xbrlapi.utilities.XBRLException;

/**
 * @author Geoffrey Shuetrim (geoff@galexy.net)
 */
public class ArcEndImpl extends ExtendedLinkContentImpl implements ArcEnd {
	
	/**
     * Get the xlink:label attribute value.
     * @return the xlink:label attribute value.
     * @throws XBRLException if the xlink:label attribute does not exist.
     * @see org.xbrlapi.ArcEnd#getLabel()
     */
    public String getLabel() throws XBRLException {
    	Element root = getDataRootElement();
    	if (root.hasAttributeNS(Constants.XLinkNamespace,"label"))
    		return root.getAttributeNS(Constants.XLinkNamespace,"label");
    	throw new XBRLException("XLink arc ends must have an xlink:label attribute");
    }
    


    /**
     * Get the xlink:role attribute value.
     * @return the value of the id attribute or null if no
     * such attribute exists.
     * @throws XBRLException
     * @see org.xbrlapi.ArcEnd#getRole()
     */
    public String getRole() throws XBRLException {
    	Element root = getDataRootElement();
    	if (root.hasAttributeNS(Constants.XLinkNamespace,"role"))
    		return root.getAttributeNS(Constants.XLinkNamespace,"role");
    	return null;
    }
    

    
    /**
     * @see org.xbrlapi.ArcEnd#getArcsFrom()
     */
    public FragmentList<Arc> getArcsFrom() throws XBRLException {
    	return getExtendedLink().getArcsByFromLabel(this.getLabel());
    }

    /**
     * @see org.xbrlapi.ArcEnd#getArcsFromWithArcrole(String)
     */
    public FragmentList<Arc> getArcsFromWithArcrole(String arcrole) throws XBRLException {
        return getExtendedLink().getArcsByFromLabelAndArcrole(this.getLabel(),arcrole);
    }

    /**
     * @see org.xbrlapi.ArcEnd#getArcsToWithArcrole(String)
     */
    public FragmentList<Arc> getArcsToWithArcrole(String arcrole) throws XBRLException {
        return getExtendedLink().getArcsByToLabelAndArcrole(this.getLabel(),arcrole);
    }
    

    /**
     * Get the list of arcs that are to the arc end.
     * @return the list of arcs to the arc end.  The list is empty 
     * if there are no arcs to the arc end.
     * @see org.xbrlapi.ArcEnd#getArcsTo()
     */
    public FragmentList<Arc> getArcsTo() throws XBRLException {
    	logger.debug("Getting the arcs to end with label " + getLabel());
    	return getExtendedLink().getArcsByToLabel(this.getLabel());
    }


        
    /**
     * Get the id attribute value.
     * @return the value of the id attribute or null if no
     * such attribute exists.
     * @throws XBRLException
     * @see org.xbrlapi.ArcEnd#getArcEndId()
     */
    public String getArcEndId() throws XBRLException {
    	Element root = getDataRootElement();
    	if (root.hasAttribute("id"))
    		return root.getAttribute("id");
    	return null;
    }
    

    

    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -