com.github.seratch.scalikesolr.util.XMLStringBuilder.scala Maven / Gradle / Ivy
package com.github.seratch.scalikesolr.util
import java.lang.StringBuilder
class XMLStringBuilder {
val buf = new StringBuilder
def append(str: String): Unit = buf.append(str)
def appendEscaped(str: String): Unit = {
buf.append(
str
.replaceAll("&", "&")
.replaceAll("<", "<")
.replaceAll(">", ">")
.replaceAll("\"", """)
.replaceAll("'", "'"))
};
def build(): String = buf.toString
override def toString() = buf.toString
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy