1 | /* |
---|
2 | Tibisay Movil |
---|
3 | |
---|
4 | Copyright (C) 2013 Antonio Araujo (aaraujo@cenditel.gob.ve), Jose Ruiz |
---|
5 | (jruiz@cenditel.gob.ve), Fundacion Centro Nacional de Desarrollo e |
---|
6 | Investigacion en Tecnologias Libres - CENDITEL. |
---|
7 | |
---|
8 | La Fundación CENDITEL concede permiso para usar, copiar, distribuir y/o |
---|
9 | modificar este programa, reconociendo el derecho que la humanidad posee al |
---|
10 | libre acceso al conocimiento, bajo los términos de la licencia de software |
---|
11 | GPL versión 2.0 de la Free Software Foundation. |
---|
12 | |
---|
13 | Este programa se distribuye con la esperanza de que sea util, pero SIN |
---|
14 | NINGUNA GARANTIA; tampoco las implicitas garantias de MERCANTILIDAD o |
---|
15 | ADECUACION A UN PROPOSITO PARTICULAR. |
---|
16 | |
---|
17 | Para mayor información sobre los términos de la licencia ver el archivo |
---|
18 | llamado "gpl-2.0.txt" en ingles. |
---|
19 | */ |
---|
20 | |
---|
21 | package ve.gob.cenditel.tibisaymovil; |
---|
22 | |
---|
23 | import java.io.Serializable; |
---|
24 | import java.util.ArrayList; |
---|
25 | |
---|
26 | import android.util.Log; |
---|
27 | |
---|
28 | //clase que abstrae un objeto de tipo detalle de error de firma |
---|
29 | public class SignatureErrorDetail implements Serializable { |
---|
30 | /** |
---|
31 | * |
---|
32 | */ |
---|
33 | private static final long serialVersionUID = 1L; |
---|
34 | private String mSigner; |
---|
35 | private String mError; |
---|
36 | private ArrayList<String> mListError; |
---|
37 | |
---|
38 | public SignatureErrorDetail(String signer, String error){ |
---|
39 | mSigner = signer; |
---|
40 | mError = error; |
---|
41 | setListError(null); |
---|
42 | } |
---|
43 | |
---|
44 | public SignatureErrorDetail(String signer, ArrayList<String> list){ |
---|
45 | mSigner = signer; |
---|
46 | mError = null; |
---|
47 | setListError(list); |
---|
48 | } |
---|
49 | |
---|
50 | public void setName(String signer) { |
---|
51 | this.mSigner = signer; |
---|
52 | } |
---|
53 | |
---|
54 | public String getSigner() { |
---|
55 | return mSigner; |
---|
56 | } |
---|
57 | |
---|
58 | public void setError(String error) { |
---|
59 | this.mError = error; |
---|
60 | } |
---|
61 | |
---|
62 | public String getError() { |
---|
63 | return mError; |
---|
64 | } |
---|
65 | |
---|
66 | public void setListError(ArrayList<String> mlistError) { |
---|
67 | this.mListError = mlistError; |
---|
68 | } |
---|
69 | |
---|
70 | public ArrayList<String> getListError() { |
---|
71 | return mListError; |
---|
72 | } |
---|
73 | |
---|
74 | |
---|
75 | public String getTransalatedStringError() { |
---|
76 | |
---|
77 | |
---|
78 | String stringError = new String(); |
---|
79 | |
---|
80 | //Log.d("----getTransalatedStringError: size", Integer.toString(mListError.size())); |
---|
81 | |
---|
82 | // traducir la cadena y concatenarla en stringError |
---|
83 | for (int i = 0; i < mListError.size(); i++) { |
---|
84 | stringError = stringError.concat(BDOCUtils.translateError(mListError.get(i))+"\n"); |
---|
85 | //Log.d("getTranslatedStringError: error "+Integer.toString(i)+" ", mListError.get(i)); |
---|
86 | } |
---|
87 | |
---|
88 | |
---|
89 | //return mListError.get(0); |
---|
90 | return stringError; |
---|
91 | |
---|
92 | } |
---|
93 | |
---|
94 | } // fin de clase SignatureErrorDetail |
---|