PDFGBaseException.java
2.86 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.pdfg.exception;
import com.adobe.pdfg.exception.ExceptionStackTrace;
import com.adobe.pdfg.exception.PDFGError;
import java.io.Serializable;
public class PDFGBaseException
extends Exception
implements Serializable {
private static final int ERRORCODE_PADDING_LENGTH = 3;
private static final String nl = System.getProperty("line.separator");
private static final long serialVersionUID = 6464316886653262389L;
private PDFGBaseException fallbackConverterException;
private PDFGError m_error;
private String m_causeStackTrace;
public PDFGBaseException(PDFGError error, ExceptionStackTrace arg1) {
super(error != null ? error.getMessage() : null);
this.m_error = error;
this.m_causeStackTrace = arg1.getStackTrace();
}
public PDFGBaseException(PDFGError error, Throwable cause) {
super(error != null ? error.getMessage() : null, cause);
this.m_error = error;
}
public PDFGBaseException(PDFGError error) {
super(error != null ? error.getMessage() : null);
this.m_error = error;
}
public void setFallbackConversionException(PDFGBaseException fallbackConverterException) {
this.fallbackConverterException = fallbackConverterException;
this.m_error.setFallbackConverterException(fallbackConverterException);
}
public String toString() {
if (this.m_error != null) {
StringBuilder buf = new StringBuilder("ALC-").append(this.m_error.getComponentUID()).append("-").append(PDFGBaseException.paddingString(Integer.toString(this.m_error.getErrorCode()), 3, '0', true));
int minorCode = 0;
buf.append("-").append(PDFGBaseException.paddingString(Integer.toString(minorCode), 3, '0', true));
buf.append(": ").append(this.getClass().getName());
String msg = this.getLocalizedMessage();
if (msg != null) {
buf.append(": ").append(msg);
}
if (this.m_causeStackTrace != null) {
buf.append(nl).append("Caused by: ");
buf.append(this.m_causeStackTrace);
}
return buf.toString();
}
return super.toString();
}
private static String paddingString(String s, int n, char c, boolean paddingLeft) {
StringBuilder str = new StringBuilder(s);
int strLength = str.length();
if (n > 0 && n > strLength) {
for (int i = 0; i <= n; ++i) {
if (paddingLeft) {
if (i >= n - strLength) continue;
str.insert(0, c);
continue;
}
if (i <= strLength) continue;
str.append(c);
}
}
return str.toString();
}
public int getErrorCode() {
return this.m_error.getErrorCode();
}
}