Package org.refcodes.tabular
Class ExceptionColumnImpl
- java.lang.Object
-
- org.refcodes.tabular.AbstractColumn<java.lang.Throwable>
-
- org.refcodes.tabular.ExceptionColumnImpl
-
- All Implemented Interfaces:
java.lang.Cloneable,org.refcodes.mixin.KeyAccessor<java.lang.String>,org.refcodes.mixin.TypeAccessor<java.lang.Throwable>,Column<java.lang.Throwable>
public class ExceptionColumnImpl extends AbstractColumn<java.lang.Throwable> implements java.lang.Cloneable
The Class ExceptionColumnImpl.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.KeyAccessor
org.refcodes.mixin.KeyAccessor.KeyBuilder<K extends java.lang.Object,B extends org.refcodes.mixin.KeyAccessor.KeyBuilder<K,B>>, org.refcodes.mixin.KeyAccessor.KeyMutator<K extends java.lang.Object>, org.refcodes.mixin.KeyAccessor.KeyProperty<K extends java.lang.Object>
-
-
Constructor Summary
Constructors Constructor Description ExceptionColumnImpl(java.lang.String aKey)Creates anExceptionColumnImplwhich will consider the stack trace in its string representationAbstractColumn.toStorageString(Object).ExceptionColumnImpl(java.lang.String aKey, PrintStackTrace aPrintStackTrace)Creates anExceptionColumnImplwhich can consider or omit the stack trace in its string representationAbstractColumn.toStorageString(Object).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()java.lang.ThrowablefromStorageStrings(java.lang.String[] aStringValues)AColumnimplementation can provide its own text exchange format for the given objects.java.lang.StringtoPrintable(java.lang.Throwable aValue)AColumnimplementation can provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI escape codes).java.lang.String[]toStorageStrings(java.lang.Throwable aValue)AColumnimplementation can provide its own text exchange format for the given objects.-
Methods inherited from class org.refcodes.tabular.AbstractColumn
contains, fromStorageString, get, getKey, getType, remove, toStorageString
-
-
-
-
Constructor Detail
-
ExceptionColumnImpl
public ExceptionColumnImpl(java.lang.String aKey)
Creates anExceptionColumnImplwhich will consider the stack trace in its string representationAbstractColumn.toStorageString(Object).- Parameters:
aKey- The key for theExceptionColumnImpl.
-
ExceptionColumnImpl
public ExceptionColumnImpl(java.lang.String aKey, PrintStackTrace aPrintStackTrace)Creates anExceptionColumnImplwhich can consider or omit the stack trace in its string representationAbstractColumn.toStorageString(Object).- Parameters:
aKey- The key for theExceptionColumnImpl.aPrintStackTrace- the print stack trace
-
-
Method Detail
-
toStorageStrings
public java.lang.String[] toStorageStrings(java.lang.Throwable aValue)
AColumnimplementation can provide its own text exchange format for the given objects. This method enables theColumnto convert a value of the given type to aStringarray and viaColumn.fromStorageStrings(String[])back to the value (bijective). This method supports data sinks (such as Amazon's SimpleDb) which provide dedicated support for multiple values in a row's entry: In case T is an array type, then the storageStringrepresentations of the elements in that array may be placed in dedicated entries of the returnedStringarray. In case T is not an array type then the returnedStringarray may contain just one value. In case data sinks (such as relational databases) are to be addressed which allow only a single value in a row's entry, then the methodColumn.toStorageString(Object)may be used instead.- Specified by:
toStorageStringsin interfaceColumn<java.lang.Throwable>- Parameters:
aValue- the element to be converted to aStringarray.- Returns:
- The
Stringarray representation of the value.
-
fromStorageStrings
public java.lang.Throwable fromStorageStrings(java.lang.String[] aStringValues) throws java.text.ParseExceptionAColumnimplementation can provide its own text exchange format for the given objects. This method enables theColumnto convert aStringarray value to a value of the given type and viaColumn.toStorageStrings(Object)back to theStringarray (bijective). This method supports data sinks (such as Amazon's SimpleDb) which provide dedicated support for multiple values in a row's entry: In case T is an array type, then the storageStringrepresentations of the elements in that array may be placed in dedicated entries of the providedStringarray. In case T is not an array type then the passedStringarray may contain just one value. In case data sinks (such as relational databases) are to be addressed which allow only a single value in a row's entry, then the methodColumn.fromStorageString(String)may be used instead.- Specified by:
fromStorageStringsin interfaceColumn<java.lang.Throwable>- Parameters:
aStringValues- The value to be converted to a type instance.- Returns:
- The type representation of the value.
- Throws:
java.text.ParseException- in case parsing theStringwas not possible
-
toPrintable
public java.lang.String toPrintable(java.lang.Throwable aValue)
AColumnimplementation can provide its own printable format of the given objects; for example a human readable text representation of the value (or in very specialized cases even enriched with ANSI escape codes). This method enables theColumnto convert a value of the given type to a human readable text. The human readable text, in comparison to the methodObject.toString()(orColumn.toStorageString(Object)) is not intended to be converted back to the actual value (not bijective). This method may be used aHeaderinstance's methodHeaderTemplate.toPrintable(Record).- Specified by:
toPrintablein interfaceColumn<java.lang.Throwable>- Overrides:
toPrintablein classAbstractColumn<java.lang.Throwable>- Parameters:
aValue- the element to be converted to a human readable text.- Returns:
- The human readable representation of the value.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classAbstractColumn<java.lang.Throwable>- Throws:
java.lang.CloneNotSupportedException
-
-