org.acra.collector
Class CrashReportDataFactory

java.lang.Object
  extended by org.acra.collector.CrashReportDataFactory

public final class CrashReportDataFactory
extends Object

Responsible for creating the CrashReportData for an Exception.

Also responsible for holding the custom data to send with each report.

Since:
4.3.0
Author:
William Ferguson

Constructor Summary
CrashReportDataFactory(android.content.Context context, android.content.SharedPreferences prefs, android.text.format.Time appStartDate, String initialConfiguration)
           
 
Method Summary
 CrashReportData createCrashData(Throwable th, boolean isSilentReport, Thread brokenThread)
          Collects crash data.
 String getCustomData(String key)
          Gets the current value for a key in the custom data field.
 String putCustomData(String key, String value)
           Adds a custom key and value to be reported with the generated CashReportData.
 String removeCustomData(String key)
          Removes a key/value pair from the custom data field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrashReportDataFactory

public CrashReportDataFactory(android.content.Context context,
                              android.content.SharedPreferences prefs,
                              android.text.format.Time appStartDate,
                              String initialConfiguration)
Method Detail

putCustomData

public String putCustomData(String key,
                            String value)

Adds a custom key and value to be reported with the generated CashReportData.

The key/value pairs will be stored in the "custom" column, as a text containing one 'key = value' pair on each line.

Parameters:
key - A key for your custom data.
value - The value associated to your key.
Returns:
The previous value for this key if there was one, or null.

removeCustomData

public String removeCustomData(String key)
Removes a key/value pair from the custom data field.

Parameters:
key - The key of the data to be removed.
Returns:
The value for this key before removal.

getCustomData

public String getCustomData(String key)
Gets the current value for a key in the custom data field.

Parameters:
key - The key of the data to be retrieved.
Returns:
The value for this key.

createCrashData

public CrashReportData createCrashData(Throwable th,
                                       boolean isSilentReport,
                                       Thread brokenThread)
Collects crash data.

Parameters:
th - Throwable that caused the crash.
isSilentReport - Whether to report this report as being sent silently.
brokenThread2 -
Returns:
CrashReportData representing the current state of the application at the instant of the Exception.


Copyright © 2010-2013. All Rights Reserved.