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

io.polaris.core.string.XmlEscape Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package io.polaris.core.string;

/**
 * @author Qt
 * @since 1.8
 */
public class XmlEscape extends StringReplacerChain {
	public static final String[][] BASIC_ESCAPE = { //
		{"'", "'"}, // " - single-quote
		{"\"", """}, // " - double-quote
		{"&", "&"}, // & - ampersand
		{"<", "<"}, // < - less-than
		{">", ">"}, // > - greater-than
	};

	public XmlEscape() {
		for (String[] escape : BASIC_ESCAPE) {
			add(s -> s.replace(escape[0], escape[1]));
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy