コード例 #1
0
    public void marshall(PrintWriter wrt, String prefix, GeneralFailure value) {
      String msg = value.getMessage();

      wrt.print(prefix);
      wrt.print("exception.name=");

      if ((msg != null) && (msg.length() > 0)) {
        wrt.print(value.getClass().getName());
        wrt.println(" " + msg);
      } else {
        wrt.println(value.getClass().getName());
      }
    }
コード例 #2
0
 public void marshall(XMLStreamWriter wrt, GeneralFailure gf) throws Exception {
   assert gf != null;
   wrt.writeStartElement("exception");
   wrt.writeAttribute("name", gf.getClass().getName());
   String msg = gf.getMessage();
   if (msg != null) {
     wrt.writeAttribute("message", gf.getMessage());
     // StringWriter sw = new StringWriter(200);
     // gf.printStackTrace(new PrintWriter(sw));
     // wrt.writeAttribute("stacktrace", sw.toString());
     // sw.close();
   }
   wrt.writeEndElement();
 }