Signals an error condition during a build
| Constructor: |
public BuildException() {
super();
}
Constructs a build exception with no descriptive information. |
public BuildException(String message) {
super(message);
}
Constructs an exception with the given descriptive message. Parameters:
message - A description of or information about the exception.
Should not be null.
|
public BuildException(Throwable cause) {
super(cause.toString());
this.cause = cause;
}
Constructs an exception with the given exception as a root cause. Parameters:
cause - The exception that might have caused this one.
Should not be null.
|
public BuildException(String message,
Throwable cause) {
super(message);
this.cause = cause;
}
Constructs an exception with the given message and exception as
a root cause. Parameters:
message - A description of or information about the exception.
Should not be null unless a cause is specified.
cause - The exception that might have caused this one.
May be null.
|
public BuildException(String message,
Location location) {
super(message);
this.location = location;
}
Constructs an exception with the given descriptive message and a
location in a file. Parameters:
message - A description of or information about the exception.
Should not be null.
location - The location in the project file where the error
occurred. Must not be null.
|
public BuildException(Throwable cause,
Location location) {
this(cause);
this.location = location;
}
Constructs an exception with the given exception as
a root cause and a location in a file. Parameters:
cause - The exception that might have caused this one.
Should not be null.
location - The location in the project file where the error
occurred. Must not be null.
|
public BuildException(String msg,
Throwable cause,
Location location) {
this(msg, cause);
this.location = location;
}
Constructs an exception with the given message and exception as
a root cause and a location in a file. Parameters:
msg - A description of or information about the exception.
Should not be null unless a cause is specified.
cause - The exception that might have caused this one.
May be null.
location - The location in the project file where the error
occurred. Must not be null.
|
| Method from org.apache.tools.ant.BuildException Detail: |
public Throwable getCause() {
return getException();
}
Returns the nested exception, if any. |
public Throwable getException() {
return cause;
}
Returns the nested exception, if any. |
public Location getLocation() {
return location;
}
Returns the file location where the error occurred. |
public void printStackTrace() {
printStackTrace(System.err);
}
Prints the stack trace for this exception and any
nested exception to System.err. |
public void printStackTrace(PrintStream ps) {
synchronized (ps) {
super.printStackTrace(ps);
if (cause != null) {
ps.println("--- Nested Exception ---");
cause.printStackTrace(ps);
}
}
}
Prints the stack trace of this exception and any nested
exception to the specified PrintStream. |
public void printStackTrace(PrintWriter pw) {
synchronized (pw) {
super.printStackTrace(pw);
if (cause != null) {
pw.println("--- Nested Exception ---");
cause.printStackTrace(pw);
}
}
}
Prints the stack trace of this exception and any nested
exception to the specified PrintWriter. |
public void setLocation(Location location) {
this.location = location;
}
Sets the file location where the error occurred. |
public String toString() {
return location.toString() + getMessage();
}
Returns the location of the error and the error message. |