org.apache.tools.antClass BuildException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.apache.tools.ant.BuildException
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- BuildTimeoutException, ExitStatusException, UnsupportedAttributeException, UnsupportedElementException
public class BuildException extends java.lang.RuntimeExceptionSignals an error condition during a build
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor and Description BuildException()Constructs a build exception with no descriptive information.BuildException(java.lang.String message)Constructs an exception with the given descriptive message.BuildException(java.lang.String message, Location location)Constructs an exception with the given descriptive message and a location in a file.BuildException(java.lang.String message, java.lang.Throwable cause)Constructs an exception with the given message and exception as a root cause.BuildException(java.lang.String msg, java.lang.Throwable cause, Location location)Constructs an exception with the given message and exception as a root cause and a location in a file.BuildException(java.lang.Throwable cause)Constructs an exception with the given exception as a root cause.BuildException(java.lang.Throwable cause, Location location)Constructs an exception with the given exception as a root cause and a location in a file.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description java.lang.ThrowablegetException()Deprecated.UseThrowable.getCause()instead.LocationgetLocation()Returns the file location where the error occurred.voidsetLocation(Location location)Sets the file location where the error occurred.java.lang.StringtoString()Returns the location of the error and the error message.
Constructor Detail
BuildException
public BuildException()Constructs a build exception with no descriptive information.
BuildException
public BuildException(java.lang.String message)Constructs an exception with the given descriptive message.
- Parameters:
message- A description of or information about the exception. Should not benull.
BuildException
public BuildException(java.lang.String message, java.lang.Throwable 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 benullunless a cause is specified.cause- The exception that might have caused this one. May benull.
BuildException
public BuildException(java.lang.String msg, java.lang.Throwable cause, 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 benullunless a cause is specified.cause- The exception that might have caused this one. May benull.location- The location in the project file where the error occurred. Must not benull.
BuildException
public BuildException(java.lang.Throwable cause)Constructs an exception with the given exception as a root cause.
- Parameters:
cause- The exception that might have caused this one. Should not benull.
BuildException
public BuildException(java.lang.String message, 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 benull.location- The location in the project file where the error occurred. Must not benull.
BuildException
public BuildException(java.lang.Throwable cause, 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 benull.location- The location in the project file where the error occurred. Must not benull.
Method Detail
getException
@Deprecated public java.lang.Throwable getException()Deprecated. UseThrowable.getCause()instead.Returns the nested exception, if any.
- Returns:
- the nested exception, or
nullif no exception is associated with this one
toString
public java.lang.String toString()Returns the location of the error and the error message.
- Overrides:
toStringin classjava.lang.Throwable- Returns:
- the location of the error and the error message
setLocation
public void setLocation(Location location)Sets the file location where the error occurred.
- Parameters:
location- The file location where the error occurred. Must not benull.
getLocation
public Location getLocation()Returns the file location where the error occurred.
- Returns:
- the file location where the error occurred.