net.sourceforge.plantuml.code.ArobaseStringCompressor2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.code;
import net.sourceforge.plantuml.StringUtils;
public class ArobaseStringCompressor2 implements StringCompressor {
// ::remove file when __CORE__
public String compress(String data) {
return clean2(data);
}
public String decompress(String s) {
return clean2(s);
}
private String clean2(String s) {
// s = s.replace("\0", "");
s = StringUtils.trin(s);
// s = s.replace("\r", "").replaceAll("\n+$", "");
if (s.startsWith("@start")) {
return s;
}
return "@startuml\n" + s + "\n@enduml";
}
}