org.mentalog.encoder
Class ThrowableEncoder

java.lang.Object
  extended by org.mentalog.encoder.ThrowableEncoder
All Implemented Interfaces:
Encoder

public class ThrowableEncoder
extends Object
implements Encoder


Field Summary
 
Fields inherited from interface org.mentalog.encoder.Encoder
ASCII, BYTE_OR_CHAR_ARRAY, CHAR_SEQUENCE, NULL, THROWABLE
 
Constructor Summary
ThrowableEncoder()
           
 
Method Summary
 boolean encode(Object obj, ByteBuffer bb, int varargsPos, int varargsLen)
          Encode the given object into the provided byte buffer.
static String getStackTrace(Throwable throwable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThrowableEncoder

public ThrowableEncoder()
Method Detail

encode

public boolean encode(Object obj,
                      ByteBuffer bb,
                      int varargsPos,
                      int varargsLen)
Description copied from interface: Encoder
Encode the given object into the provided byte buffer. Note: You should use instanceof to check and cast the object to a type that this encoder can encode. Each encoder receives all objects passed to the log() method. If a encoder receives an object it does not support, it does nothing and returns false, so the next encoder in the chain will be applied.

Specified by:
encode in interface Encoder
Parameters:
obj - That object to be encoded.
bb - The byte buffer that will receive the encoded object.
Returns:
true if the object was encoded, false otherwise

getStackTrace

public static String getStackTrace(Throwable throwable)


Copyright © 2013. All Rights Reserved.