File: IThrowableWrapper.java

package info (click to toggle)
emma-coverage 2.0.5312%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 2,000 kB
  • ctags: 3,667
  • sloc: java: 23,109; xml: 414; makefile: 22
file content (57 lines) | stat: -rw-r--r-- 2,266 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* Copyright (C) 2003 Vladimir Roubtsov. All rights reserved.
 * 
 * This program and the accompanying materials are made available under
 * the terms of the Common Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/cpl-v10.html
 * 
 * $Id: IThrowableWrapper.java,v 1.1.1.1 2004/05/09 16:57:58 vlad_r Exp $
 */
package com.vladium.util.exception;

import java.io.PrintStream;
import java.io.PrintWriter;

// ----------------------------------------------------------------------------
/**
 * TODO: javadoc
 * 
 * Any exception that wraps around another exception and wishes to be fully 
 * inspectable by {@link ExceptionCommon} should implement this interface.
 * Note that JDK 1.4+ obsoletes the need for an explicit interface like this,
 * although the implementation in {@link ExceptionCommon} is upwards compatible
 * with it.
 * 
 * @author Vlad Roubtsov, (C) 2002
 */
interface IThrowableWrapper
{
    // public: ................................................................

    /**
     * Gets the Throwable being wrapped. This method signature is the same as
     * Throwable.getCause() in J2SE 1.4.
     * 
     * @return Throwable being wrapped by this object [can be null].
     */
    Throwable getCause ();
     
    /**
     * Every exception hierarchy implementing this interface must ensure that
     * this method delegates to super.printStackTrace(pw) where 'super' is the
     * first superclass not implementing IThrowableWrapper. This is used by
     * {@link ExceptionCommon} to avoid infinite
     * recursion and is not meant to be called by other classes.
     */
    void __printStackTrace (PrintWriter pw);

    /**
     * Every exception hierarchy implementing this interface must ensure that
     * this method delegates to super.printStackTrace(ps) where 'super' is the
     * first superclass not implementing IThrowableWrapper. This is used by
     * {@link ExceptionCommon} to avoid infinite
     * recursion and is not meant to be called by other classes.
     */
    void __printStackTrace (PrintStream ps);

} // end of interface
// ----------------------------------------------------------------------------