Package org.atc.tools.ant

Examples of org.atc.tools.ant.Item


    FormattedItem fi = new FormattedItem();
    fi.setItem(i);
    fi.setFormat(fmt);

    Item item = fi.getItem();
    fi.setValue(String.format("\"%s\",%s,\"%s\", \"%s\"",
        item.getOrigin().trim(),
        item.getLineNumber(),
        item.getType(),
        item.getContent().trim()));

    return fi;
  }
View Full Code Here


  public FormattedItem format(Format fmt, Item i) {
    FormattedItem fi = new FormattedItem();
    fi.setItem(i);
    fi.setFormat(fmt);

    Item item = fi.getItem();
    fi.setValue(String.format("<item origin=\"%s\" line=\"%s\" type=\"%s\">%s</item>",
        item.getOrigin().trim(),
        item.getLineNumber(),
        item.getType(),
        item.getContent().trim()));

    return fi;
  }
View Full Code Here

public class GenericItemParser implements ItemParser {

  public Item parse(String line) {
    //The content of the todo, e.g. "Refactor" in TODO Refactor
    String content = "";
    Item item = new Item();

    //TODO: this was a "simplest implementation" quick hack; make this more scalable and elegant
    // It allowed me to unit test and prove it was possible, but it's not brilliant!
    //We do tests on the upper-case lines, so we include lower case TODOs or FIXMEs;
    //The substrings, however, are performed on the original line so the comments case is preserved
    String upperCaseLine = line.toUpperCase();
    if (upperCaseLine.contains("TODO")) {
      item.setType(Item.ItemType.TODO);
      content = line.substring(upperCaseLine.indexOf("TODO") + 4);
    } else if (upperCaseLine.contains("FIXME")) {
      item.setType(Item.ItemType.FIXME);
      content = line.substring(upperCaseLine.indexOf("FIXME") + 5);
    }
    item.setContent(content);
    return item;
  }
View Full Code Here

TOP

Related Classes of org.atc.tools.ant.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.