Class to hold a reference to another object in the project.
| Method from org.apache.tools.ant.types.Reference Detail: |
public Project getProject() {
return project;
}
Get the associated project, if any; may be null. |
public String getRefId() {
return refid;
}
Get the reference id of this reference. |
public Object getReferencedObject() throws BuildException {
if (project == null) {
throw new BuildException("No project set on reference to " + refid);
}
return getReferencedObject(project);
}
Resolve the reference, looking in the associated project. |
public Object getReferencedObject(Project fallback) throws BuildException {
if (refid == null) {
throw new BuildException("No reference specified");
}
Object o = project == null ? fallback.getReference(refid) : project.getReference(refid);
if (o == null) {
throw new BuildException("Reference " + refid + " not found.");
}
return o;
}
Resolve the reference, using the associated project if
it set, otherwise use the passed in project. |
public void setProject(Project p) {
this.project = p;
}
|
public void setRefId(String id) {
refid = id;
}
|