Package org.atc.tools.ant.format

Source Code of org.atc.tools.ant.format.XMLItemFormatter

package org.atc.tools.ant.format;

import org.atc.tools.ant.Item;


public class XMLItemFormatter implements ItemFormatter {

  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;
  }
}
TOP

Related Classes of org.atc.tools.ant.format.XMLItemFormatter

TOP
Copyright © 2018 www.massapi.com. 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.