Exemplo n.º 1
0
 public void formatShort(Appendable out) throws IOException {
   if (!FilePosition.PREDEFINED.equals(this)) {
     MessageContext mc = new MessageContext();
     mc.addInputSource(source);
     out.append(mc.abbreviate(source)).append(":").append(String.valueOf(this.startLineNo));
   } else {
     out.append("predefined");
   }
 }
Exemplo n.º 2
0
 public void format(MessageContext context, Appendable out) throws IOException {
   if (!FilePosition.PREDEFINED.equals(this)) {
     source.format(context, out);
     out.append(":")
         .append(String.valueOf(this.startLineNo))
         .append("+")
         .append(String.valueOf(this.startCharInLine));
     if (this.startCharInFile != this.endCharInFile) {
       out.append(" - ");
       if (this.startLineNo != this.endLineNo) {
         out.append(String.valueOf(this.endLineNo)).append("+");
       }
       out.append(String.valueOf(this.endCharInLine));
     }
   } else {
     out.append("predefined");
   }
 }