當前位置: 首頁>>代碼示例>>Java>>正文


Java Reference.getRefId方法代碼示例

本文整理匯總了Java中org.apache.tools.ant.types.Reference.getRefId方法的典型用法代碼示例。如果您正苦於以下問題:Java Reference.getRefId方法的具體用法?Java Reference.getRefId怎麽用?Java Reference.getRefId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.tools.ant.types.Reference的用法示例。


在下文中一共展示了Reference.getRefId方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: merge

import org.apache.tools.ant.types.Reference; //導入方法依賴的package包/類
/**
 * Returns a VersionInfo that reflects any inherited version information.
 * @return merged version information.
 */
public VersionInfo merge() {
    if (isReference()) {
        VersionInfo refVersion = (VersionInfo)
                            getCheckedRef(VersionInfo.class,
                "VersionInfo");
        return refVersion.merge();
    }
        Reference currentRef = this.getExtends();
        if (currentRef == null) {
                return this;
        }
        Vector stack = new Vector(5);
        stack.addElement(this);
        while (currentRef != null) {
        Object obj = currentRef.getReferencedObject(getProject());
        if (obj instanceof VersionInfo) {
                VersionInfo current = (VersionInfo) obj;
                if (current.isReference()) {
                current = (VersionInfo)
                                            current.getCheckedRef(VersionInfo.class,
                                "VersionInfo");
                }
                if (stack.contains(current)) {
                        throw this.circularReference();
                }
                stack.addElement(current);
                currentRef = current.getExtends();
        } else {
                throw new BuildException("Referenced element "
                + currentRef.getRefId() + " is not a versioninfo.");
        }
        }
        return new VersionInfo(stack);
}
 
開發者ID:cniweb,項目名稱:ant-contrib,代碼行數:39,代碼來源:VersionInfo.java

示例2: setRefid

import org.apache.tools.ant.types.Reference; //導入方法依賴的package包/類
/**
 * Set the ResourceCollection reference.
 * @param r the Reference.
 */
public void setRefid(Reference r) {
    Object o = r.getReferencedObject();
    if (!(o instanceof ResourceCollection)) {
        throw new BuildException("%s doesn\'t denote a ResourceCollection",
            r.getRefId());
    }
    add((ResourceCollection) o);
}
 
開發者ID:apache,項目名稱:ant,代碼行數:13,代碼來源:ResourceCount.java

示例3: getClassLoaderForPath

import org.apache.tools.ant.types.Reference; //導入方法依賴的package包/類
/**
 * Convenience overloaded version of {@link #getClassLoaderForPath(Project, Path,
 * String, boolean)}.
 *
 * <p>Delegates to the other one after extracting the referenced
 * Path from the Project. This checks also that the passed
 * Reference is pointing to a Path all right.</p>
 * @param p current Ant project
 * @param ref Reference to Path structure
 * @param reverseLoader if set to true this new loader will take
 * precedence over its parent (which is contra the regular
 * classloader behaviour)
 * @return The class loader
 */
public static ClassLoader getClassLoaderForPath(
    Project p, Reference ref, boolean reverseLoader) {
    String pathId = ref.getRefId();
    Object path = p.getReference(pathId);
    if (!(path instanceof Path)) {
        throw new BuildException(
            "The specified classpathref %s does not reference a Path.",
            pathId);
    }
    String loaderId = MagicNames.REFID_CLASSPATH_LOADER_PREFIX + pathId;
    return getClassLoaderForPath(p, (Path) path, loaderId, reverseLoader);
}
 
開發者ID:apache,項目名稱:ant,代碼行數:27,代碼來源:ClasspathUtils.java

示例4: setClasspathref

import org.apache.tools.ant.types.Reference; //導入方法依賴的package包/類
/**
 * Delegate method handling the @classpathref attribute.
 *
 * <p>This attribute can add a referenced path-like structure to the
 * classpath.</p>
 *
 * @param r the reference to the classpath.
 */
public void setClasspathref(Reference r) {
    this.classpathId = r.getRefId();
    createClasspath().setRefid(r);
}
 
開發者ID:apache,項目名稱:ant,代碼行數:13,代碼來源:ClasspathUtils.java

示例5: setLoaderRef

import org.apache.tools.ant.types.Reference; //導入方法依賴的package包/類
/**
 * Sets the loaderRef.
 * @param r the reference to the loader.
 */
public void setLoaderRef(Reference r) {
    this.loaderId = r.getRefId();
}
 
開發者ID:apache,項目名稱:ant,代碼行數:8,代碼來源:ClasspathUtils.java


注:本文中的org.apache.tools.ant.types.Reference.getRefId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。