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

com.github.seratch.scalikesolr.util.XMLStringBuilder.scala Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
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