www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 971a71bf991fa341d830bcf60ea22eb7a13cc1e7
parent d13741795aa6ff15026e2a35ea4b9c51f3def348
Author: Bertrand BRUN <bertrand0brun@gmail.com>
Date:   Sat, 12 Feb 2011 12:00:22 +0100

Changement du nom de paquetage pour les exceptions
Diffstat:
Dcode/PtiClic/src/exception/PtiClicException.java | 47-----------------------------------------------
Acode/PtiClic/src/org/pticlic/exception/PtiClicException.java | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 47 deletions(-)

diff --git a/code/PtiClic/src/exception/PtiClicException.java b/code/PtiClic/src/exception/PtiClicException.java @@ -1,47 +0,0 @@ -package exception; - -import java.io.Serializable; - -import com.google.gson.Gson; - -public class PtiClicException extends Exception { - - private static final long serialVersionUID = 1L; - private Error error; - - private static class Error implements Serializable { - - private static final long serialVersionUID = 1L; - private int num; - private String msg; - - public Error() {} - - public Error(int num, String msg) { - this.num = num; - this.msg = msg; - } - - public int getNum() { - return num; - } - - public String getMsg() { - return msg; - } - } - - public PtiClicException(int num, String msg) { - this.error = new Error(num, msg); - } - - public PtiClicException(String json) { - Gson gson = new Gson(); - error = gson.fromJson(json, Error.class); - } - - public String getMessage() { - return "Erreur numero: " + error.getNum() + "\n" + error.getMsg(); - } - -} diff --git a/code/PtiClic/src/org/pticlic/exception/PtiClicException.java b/code/PtiClic/src/org/pticlic/exception/PtiClicException.java @@ -0,0 +1,51 @@ +package org.pticlic.exception; + +import java.io.Serializable; + +import com.google.gson.Gson; + +public class PtiClicException extends Exception { + + private static final long serialVersionUID = 1L; + private Error error; + + public static class Error implements Serializable { + + private static final long serialVersionUID = 1L; + private int num; + private String msg; + + public Error() {} + + public Error(int num, String msg) { + this.num = num; + this.msg = msg; + } + + public int getNum() { + return num; + } + + public String getMsg() { + return msg; + } + } + + public PtiClicException(Error error) { + this.error = error; + } + + public PtiClicException(int num, String msg) { + this.error = new Error(num, msg); + } + + public PtiClicException(String json) { + Gson gson = new Gson(); + error = gson.fromJson(json, Error.class); + } + + public String getMessage() { + return "Erreur numero: " + error.getNum() + "\n" + error.getMsg(); + } + +}