Example #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;
 }
Example #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();
 }
Example #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();
 }
Example #4
0
 public List<String> getCode() {
   return cl.getCode();
 }