|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.northconcepts.datapipeline.core.DataException
public class DataException
Indicates an error has occurred during the course of execution.
DataException retrofits RuntimeException with the ability to contain
properties and to prepend text to the message after construction.
| Constructor Summary | |
|---|---|
DataException()
Constructs a new exception. |
|
DataException(String message)
Constructs a new exception with the specified detail message. |
|
DataException(String message,
Throwable cause)
Constructs a new exception with the specified detail message and cause. |
|
DataException(Throwable cause)
Constructs a new exception with the specified cause. |
|
| Method Summary | |
|---|---|
Object |
get(String name)
Returns the value mapped to the specified key or null. |
boolean |
getAsBoolean(String name)
Returns the value mapped to the specified key as a boolean or throws NullPointeException. |
Date |
getAsDatetime(String name)
Returns the value mapped to the specified key as a Date or null. |
double |
getAsDouble(String name)
Returns the value mapped to the specified key as a double or throws NullPointeException. |
int |
getAsInteger(String name)
Returns the value mapped to the specified key as an int or throws NullPointeException. |
long |
getAsLong(String name)
Returns the value mapped to the specified key as a long or throws NullPointeException. |
String |
getAsString(String name)
Returns the value mapped to the specified key as a String or null. |
String |
getFieldName()
Returns the field name associated with this exception. |
String |
getMessage()
Returns the detail message string of this exception along with any prefixed text. |
String |
getMessageWithProperties()
Returns the detail message string of this exception along with any prefixed text and properties (name-value pairs). |
Map<String,Object> |
getProperties()
Returns the values associated with this exception as a Map. |
String |
getPropertiesAsString()
|
Record |
getRecord()
Returns the record associated with this exception. |
DataException |
prefixMessageWith(String message)
Prefixes this exception's message with the specified text. |
void |
printStackTrace(PrintStream s)
Prints this throwable and its backtrace to the specified print stream. |
void |
printStackTrace(PrintWriter s)
Prints this throwable and its backtrace to the specified print writer. |
DataException |
set(String name,
boolean value)
Maps a boolean value to the specified key, overwriting any previous association. |
DataException |
set(String name,
char value)
Maps a character value to the specified key, overwriting any previous association. |
DataException |
set(String name,
double value)
Maps a double value to the specified key, overwriting any previous association. |
DataException |
set(String name,
int value)
Maps an int value to the specified key, overwriting any previous association. |
DataException |
set(String name,
long value)
Maps a long value to the specified key, overwriting any previous association. |
DataException |
set(String name,
Object value)
Maps a value to the specified key, overwriting any previous association. |
DataException |
setFieldName(String fieldName)
sets the field name associated with this exception. |
DataException |
setRecord(Record record)
Sets the record associated with this exception. |
static DataException |
wrap(String message,
Throwable exception)
Converts an exception to a DataException and prefixes the original message with the specified text. |
static DataException |
wrap(Throwable exception)
Converts an exception to a DataException. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DataException()
public DataException(String message)
public DataException(Throwable cause)
public DataException(String message,
Throwable cause)
| Method Detail |
|---|
public static DataException wrap(String message,
Throwable exception)
DataException and prefixes the original message with the specified text.
If the supplied exception is an instanceof DataException, it will be returned, otherwise it will be
nested inside a DataException. In either case the result message will be prefixed with the supplied text.
message - the text to prefix to the original messageexception - the exception to convert
public static DataException wrap(Throwable exception)
DataException. If the supplied exception is an instanceof DataException,
it will be returned, otherwise it will be nested inside a DataException.
exception - the exception to convert
public Object get(String name)
null.
public String getAsString(String name)
String or null.
public int getAsInteger(String name)
int or throws NullPointeException.
public long getAsLong(String name)
long or throws NullPointeException.
public double getAsDouble(String name)
double or throws NullPointeException.
public boolean getAsBoolean(String name)
boolean or throws NullPointeException.
public Date getAsDatetime(String name)
Date or null.
public DataException set(String name,
Object value)
name - key with which the specified value is to be associated.value - value to be associated with the specified key.
public DataException set(String name,
char value)
name - key with which the specified value is to be associated.value - value to be associated with the specified key.
public DataException set(String name,
int value)
int value to the specified key, overwriting any previous association.
name - key with which the specified value is to be associated.value - value to be associated with the specified key.
public DataException set(String name,
long value)
long value to the specified key, overwriting any previous association.
name - key with which the specified value is to be associated.value - value to be associated with the specified key.
public DataException set(String name,
double value)
double value to the specified key, overwriting any previous association.
name - key with which the specified value is to be associated.value - value to be associated with the specified key.
public DataException set(String name,
boolean value)
boolean value to the specified key, overwriting any previous association.
name - key with which the specified value is to be associated.value - value to be associated with the specified key.
public String getFieldName()
public DataException setFieldName(String fieldName)
public Record getRecord()
public DataException setRecord(Record record)
public Map<String,Object> getProperties()
Map.
set(String, Object),
get(String)public String getPropertiesAsString()
public DataException prefixMessageWith(String message)
message - the text to prefix to the original message
public String getMessage()
getOriginalMessageWithPrefix().
getMessage in class Throwablepublic String getMessageWithProperties()
public void printStackTrace(PrintStream s)
printStackTrace in class Throwables - PrintStream to use for outputpublic void printStackTrace(PrintWriter s)
printStackTrace in class Throwables - PrintWriter to use for output
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||