factdimensioncontainerimpl.java

来自「xbrlapi的源码」· Java 代码 · 共 36 行

JAVA
36
字号
package org.xbrlapi.impl;

import org.w3c.dom.Element;
import org.xbrlapi.FactDimensionContainer;
import org.xbrlapi.FragmentList;
import org.xbrlapi.Item;
import org.xbrlapi.utilities.XBRLException;

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

public class FactDimensionContainerImpl extends FragmentImpl implements FactDimensionContainer {

    /**
     * Get the id attribute value of the container
     * @return the value of the id attribute for the unit or context.
     * @throws XBRLException if the id attribute is missing.
	 * @see org.xbrlapi.FactDimensionContainer#getId()
     */
    public String getId() throws XBRLException {
    	Element root = getDataRootElement();
    	if (root.hasAttribute("id")) return root.getAttribute("id");
    	throw new XBRLException("The id attribute is missing on a unit or context.");
    }

    /**
     * @see org.xbrlapi.FactDimensionContainer#getReferencingItems()
     */
    public FragmentList<Item> getReferencingItems() throws XBRLException {
        String query = "/*[*/*/@*='" + this.getId() + "']";
        return getStore().<Item>query(query);
    }

}

⌨️ 快捷键说明

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