niagara-ax/modules/cfr_output/com/tridium/platform/LocalizableConnectException.java
2026-03-17 13:31:18 -07:00

83 lines
2.5 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.Context
* javax.baja.sys.Localizable
* javax.baja.util.Lexicon
*/
package com.tridium.platform;
import java.net.ConnectException;
import java.text.MessageFormat;
import javax.baja.sys.Context;
import javax.baja.sys.Localizable;
import javax.baja.util.Lexicon;
public class LocalizableConnectException
extends ConnectException
implements Localizable {
private String lexiconModule;
private String lexiconKey;
private Object[] lexiconArgs;
public String getLexiconModule() {
return this.lexiconModule;
}
public String getLexiconKey() {
return this.lexiconKey;
}
public Object[] getLexiconArguments() {
return this.lexiconArgs;
}
public String toString(Context context) {
return LocalizableConnectException.format(this.lexiconModule, this.lexiconKey, this.lexiconArgs, context);
}
public static String format(String string, String string2, Object[] objectArray, Context context) {
try {
String string3 = Lexicon.make((String)string, (Context)context).get(string2, null);
if (string3 != null) {
return MessageFormat.format(string3, objectArray);
}
StringBuffer stringBuffer = new StringBuffer(string2);
if (objectArray != null) {
stringBuffer.append(" {");
int n = 0;
while (n < objectArray.length) {
if (n > 0) {
stringBuffer.append(", ");
}
stringBuffer.append(objectArray[n]);
++n;
}
stringBuffer.append(" }");
}
return stringBuffer.toString();
}
catch (Throwable throwable) {
throwable.printStackTrace();
return string2;
}
}
public LocalizableConnectException(String string, String string2, Object[] objectArray) {
super(LocalizableConnectException.format(string, string2, objectArray, null));
this.lexiconModule = string;
this.lexiconKey = string2;
this.lexiconArgs = objectArray;
}
public LocalizableConnectException(String string, String string2) {
this(string, string2, null);
}
public LocalizableConnectException(Lexicon lexicon, String string) {
this(lexicon.module.getModuleName(), string, null);
}
}