ch.ralscha.extdirectspring.controller
Class Configuration

java.lang.Object
  extended by ch.ralscha.extdirectspring.controller.Configuration

public class Configuration
extends Object

Configuration class to configure the way exception messages get sent back to the client If there is a mapping for the exception in exceptionToMessage and the value is not null send this value. If there is a mapping for the exception in exceptionToMessage and the value is null send exception.getMessage(). If there is no mapping and sendExceptionMessage is true send exception.getMessage(). If there is no mapping and sendExceptionMessage is false send defaultExceptionMessage. If sendStacktrace is true, send the full stacktrace in the json field 'where'.

Author:
Ralph Schaer

Constructor Summary
Configuration()
           
 
Method Summary
 String getDefaultExceptionMessage()
           
 Map<Class<?>,String> getExceptionToMessage()
           
 String getMessage(Throwable exception)
           
 boolean isSendExceptionMessage()
           
 boolean isSendStacktrace()
           
 void setDefaultExceptionMessage(String defaultExceptionMessage)
           
 void setExceptionToMessage(Map<Class<?>,String> exceptionToMessage)
           
 void setSendExceptionMessage(boolean sendExceptionMessage)
           
 void setSendStacktrace(boolean sendStacktrace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Method Detail

getDefaultExceptionMessage

public String getDefaultExceptionMessage()

setDefaultExceptionMessage

public void setDefaultExceptionMessage(String defaultExceptionMessage)

isSendExceptionMessage

public boolean isSendExceptionMessage()

setSendExceptionMessage

public void setSendExceptionMessage(boolean sendExceptionMessage)

isSendStacktrace

public boolean isSendStacktrace()

setSendStacktrace

public void setSendStacktrace(boolean sendStacktrace)

getExceptionToMessage

public Map<Class<?>,String> getExceptionToMessage()

setExceptionToMessage

public void setExceptionToMessage(Map<Class<?>,String> exceptionToMessage)

getMessage

public String getMessage(Throwable exception)


Copyright © 2010-2011. All Rights Reserved.