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

📄 itemimpl.java

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

import org.w3c.dom.Element;
import org.xbrlapi.Context;
import org.xbrlapi.Item;
import org.xbrlapi.Unit;
import org.xbrlapi.utilities.Constants;
import org.xbrlapi.utilities.XBRLException;

/**
 * @author Geoffrey Shuetrim (geoff@galexy.net)
 */

public class ItemImpl extends FactImpl implements Item {

	/** 
	 * @see org.xbrlapi.Item#getContext()
	 */
	public Context getContext() throws XBRLException {
		return getInstance().getContext(this.getContextId());
	}
	
    /** 
     * @see org.xbrlapi.Item#getContextId()
     */
    public String getContextId() throws XBRLException {
        Element root = getDataRootElement();
        if (root.hasAttribute("contextRef")) {
            return root.getAttribute("contextRef");
        }
        throw new XBRLException("The contextRef is missing on an item.");
    }
    
    /** 
     * @see org.xbrlapi.Item#getUnit()
     */
    public Unit getUnit() throws XBRLException {
        return getInstance().getUnit(this.getUnitId());
    }
    
    /** 
     * @see org.xbrlapi.Item#getUnitId()
     */
    public String getUnitId() throws XBRLException {
        Element root = getDataRootElement();
        if (root.hasAttribute("unitRef")) {
            return root.getAttribute("unitRef");
        }
        throw new XBRLException("The unitRef is missing on an item.");
    }    
	

	
	/** 
	 * Return true if the item has a nill value.
	 * @throws XBRLException
	 * @see org.xbrlapi.Item#isNill()
	 */
	public boolean isNill() throws XBRLException {
		if (this.getDataRootElement().getAttributeNS(Constants.XMLSchemaInstanceNamespace,"nill").equals("true")) return true;
		return false;
	}	
	
}

⌨️ 快捷键说明

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