private String milliString(double executionTime) {
return String.format(Locale.US, "%.3fms", executionTime);
}
private void handleInvocation(ProfilingData data) throws SAXException {
AttributesImpl attr = new AttributesImpl();
this.addStringAttribute(attr, "method", data.getMethod());
this.addStringAttribute(attr, "executionTime", this.milliString(data.getExecutionMillis()));
this.startElement("invocation", attr);
this.startElement("properties");
for (Entry<String, String> entry : data.getData().entrySet()) {
AttributesImpl attr2 = new AttributesImpl();
this.addStringAttribute(attr2, "id", entry.getKey());
this.startElement("property", attr2);
this.addData(entry.getValue());
this.endElement();
}
this.endElement();
this.startElement("arguments");
for (InstanceRepresentation arg : data.getArguments()) {
this.addArgument(arg);
}
this.endElement();
this.startElement("result");
if (data.getException() != null) {
AttributesImpl attr2 = new AttributesImpl();
this.addStringAttribute(attr2, "class", data.getException().getClass().getName());
this.addStringAttribute(attr2, "message", data.getException().getMessage());
this.addSimple("exception", attr2);
} else {
String classname;
if (data.getReturnValue().getRepresentedClass() == null) {
classname = "";
} else {
classname = data.getReturnValue().getRepresentedClass().getName();
}
AttributesImpl attr3 = new AttributesImpl();
this.addStringAttribute(attr3, "class", classname);
this.startElement("return-value", attr3);
this.addSimple("value", data.getReturnValue().getStringRepresentation());
this.endElement();
}