2026-03-17 13:31:18 -07:00

100 lines
2.5 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package javax.baja.spy;
import java.io.OutputStream;
import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.baja.file.FilePath;
import javax.baja.io.HtmlWriter;
import javax.baja.sys.BAbsTime;
import javax.baja.sys.Context;
public class SpyWriter
extends HtmlWriter {
static final SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss dd-MMM-yy zzz");
FilePath path;
Context cx;
public FilePath getPath() {
return this.path;
}
public Context getContext() {
return this.cx;
}
public HtmlWriter w(Object object) {
if (object instanceof BAbsTime) {
BAbsTime bAbsTime = (BAbsTime)object;
if (bAbsTime == null || bAbsTime.isNull()) {
this.print("null");
} else {
this.print(timeFormat.format(new Date(bAbsTime.getMillis())));
}
} else {
this.print(object);
}
return this;
}
public SpyWriter startProps() {
this.startTable(false);
return this;
}
public SpyWriter startProps(String string) {
this.startTable(false);
this.trTitle(string, 2);
return this;
}
public SpyWriter prop(Object object, Object object2) {
this.w("<tr>").th(object).td(object2).w("</tr>\n");
return this;
}
public SpyWriter prop(Object object, boolean bl) {
this.w("<tr>").th(object).td(String.valueOf(bl)).w("</tr>\n");
return this;
}
public SpyWriter prop(Object object, int n) {
this.w("<tr>").th(object).td(String.valueOf(n)).w("</tr>\n");
return this;
}
public SpyWriter prop(Object object, double d) {
this.w("<tr>").th(object).td(String.valueOf(d)).w("</tr>\n");
return this;
}
public SpyWriter endProps() {
this.endTable();
return this;
}
public SpyWriter(Writer writer, FilePath filePath) {
this(writer, filePath, null);
}
public SpyWriter(Writer writer, FilePath filePath, Context context) {
super(writer);
this.path = filePath;
this.cx = context;
}
public SpyWriter(OutputStream outputStream, FilePath filePath) {
this(outputStream, filePath, null);
}
public SpyWriter(OutputStream outputStream, FilePath filePath, Context context) {
super(outputStream);
this.path = filePath;
this.cx = context;
}
}