本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}