Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.tools.ant.types.Reference
public class Reference
extends java.lang.Object
Method Summary | |
Project |
|
String |
|
Object |
|
Object |
|
void |
|
void |
|
public Reference()
Deprecated. since 1.7. Please use
Reference(Project,String)
instead.Create a reference.
public Reference(String id)
Deprecated. since 1.7. Please use
Reference(Project,String)
instead.Create a reference to a named ID.
- Parameters:
id
- the name of this reference
public Reference(Project p, String id)
Create a reference to a named ID in a particular project.
- Parameters:
p
- the project this reference is associated withid
- the name of this reference
- Since:
- Ant 1.6.3
public Project getProject()
Get the associated project, if any; may be null.
- Returns:
- the associated project
- Since:
- Ant 1.6.3
public String getRefId()
Get the reference id of this reference.
- Returns:
- the reference id
public Object getReferencedObject() throws BuildException
Resolve the reference, looking in the associated project.
- Returns:
- the dereferenced object.
- Throws:
BuildException
- if the project is null or the reference cannot be dereferenced
- Since:
- Ant 1.6.3
- See Also:
Project.getReference(String)
public Object getReferencedObject(Project fallback) throws BuildException
Resolve the reference, using the associated project if it set, otherwise use the passed in project.
- Parameters:
fallback
- the fallback project to use if the project attribute of reference is not set.
- Returns:
- the dereferenced object.
- Throws:
BuildException
- if the reference cannot be dereferenced.
public void setProject(Project p)
Set the associated project. Should not normally be necessary; useReference(Project,String)
.
- Parameters:
p
- the project to use
- Since:
- Ant 1.6.3
public void setRefId(String id)
Set the reference id. Should not normally be necessary; useReference(Project,String)
.
- Parameters:
id
- the reference id to use