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

📄 referencepartimpl.java

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

import org.xbrlapi.FragmentList;
import org.xbrlapi.ReferencePart;
import org.xbrlapi.ReferencePartDeclaration;
import org.xbrlapi.utilities.Constants;
import org.xbrlapi.utilities.XBRLException;

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

public class ReferencePartImpl extends FragmentImpl implements ReferencePart {

    /**
     * Get the value of the reference part. 
     * @return The value of the reference part with spaces trimmed from
     * the front and end.
     * @throws XBRLException
     * @see org.xbrlapi.ReferencePart#getValue()
     */
    public String getValue() throws XBRLException {
    	return this.getDataRootElement().getTextContent().trim();
    }



    /**
     * @see org.xbrlapi.ReferencePart#getDeclaration()
     */
    public ReferencePartDeclaration getDeclaration() throws XBRLException {
    	String name = this.getLocalname();
    	String namespace = this.getNamespaceURI();
    	String query = "/"+ Constants.XBRLAPIPrefix+ ":" + "fragment[@type='org.xbrlapi.impl.ReferencePartDeclarationImpl' and "+ Constants.XBRLAPIPrefix+ ":" + "data/xsd:element/@name='" + name + "']";
    	FragmentList<ReferencePartDeclaration> declarations = getStore().<ReferencePartDeclaration>query(query);
    	for (ReferencePartDeclaration declaration: declarations) {
    		if (declaration.getTargetNamespaceURI().equals(namespace)) {
    			return declaration;
    		}
    	}
    	throw new XBRLException("The reference part has no corresponding declaration in the data store.");
    }
    
}

⌨️ 快捷键说明

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