live.document.mavenplugin.freemind.FreeMindExporter Maven / Gradle / Ivy
package live.document.mavenplugin.freemind;
import java.util.Arrays;
import java.util.List;
public class FreeMindExporter {
public String toFreeMind(String plantUmlMindMap) {
StringBuilder stringBuilder = new StringBuilder("\n" +
"";
}
private String getNote(String line) {
int i = line.indexOf("");
int j = line.indexOf(" ");
if (i >= 0 && j >= 0) {
String template = "%s ";
String note = line.substring(i + "".length(), j);
return String.format(template, escape(note));
}
return "";
}
private String escape(String nodeText) {
return nodeText.replace("\\n", "
")
.replace("<", "<")
.replace(">", ">");
}
int getLevel(String line) {
int i = line.indexOf(" ");
return i;
}
String getNodeText(String line) {
String result = removeNote(line);
int i = line.indexOf(" ");
int j = line.indexOf("]]");
int kk = line.indexOf("* [[");
if (kk >= 0 && j > 0) {
result = result.substring(j + 2);
} else if (i > 0) {
result = result.substring(i + 1);
}
if (result.trim().endsWith(">>")) {
int k = result.lastIndexOf("<<");
result = result.substring(0, k);
}
return result.trim() + (line.indexOf("Link(") >= 0 ? " [Link]" : "");
}
private String removeNote(String s) {
int i = s.indexOf("");
int j = s.indexOf(" ");
if (i >= 0 && j >= 0) {
s = s.substring(0, i) + s.substring(j + " ".length());
}
return s;
}
}