All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.code.ArobaseStringCompressor2 Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// 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";
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy