Exemplo n.º 1
0
 public StringBuffer getCodeBuffer() {
   StringBuffer sb = new StringBuffer();
   List<String> lines = cl.getCode();
   for (String line : lines) {
     sb.append(line);
     sb.append(EOL);
   }
   return sb;
 }
Exemplo n.º 2
0
 public String getSlice(int startLine, int endLine) {
   StringBuffer sb = new StringBuffer();
   List lines = cl.getCode();
   for (int i = (startLine == 0 ? startLine : startLine - 1);
       i < endLine && i < lines.size();
       i++) {
     if (sb.length() != 0) {
       sb.append(EOL);
     }
     sb.append((String) lines.get(i));
   }
   return sb.toString();
 }
Exemplo n.º 3
0
 /**
  * Within Sonar Ecosystem - absolute path to file containing code, whereas in fact existence of
  * such file not guaranteed - see {@link StringCodeLoader}.
  */
 public String getFileName() {
   return cl.getFileName();
 }
Exemplo n.º 4
0
 public List<String> getCode() {
   return cl.getCode();
 }