/* * [XMLReservedChars.java] * * Summary: Converts raw text to HTML quoting dangerous characters such as & which it converts to &amp. * * Copyright: (c) 2002-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 4.5 2009-02-26 add both Java string quoting and plain for Java search/regexes. */ package com.mindprod.quoter; import com.mindprod.entities.EntifyStrings; /** * Converts raw text to HTML quoting dangerous characters such as & which it converts to &amp. * * @author Roedy Green, Canadian Mind Products * @version 4.5 2009-02-26 add both Java string quoting and plain for Java search/regexes. * @since 2002-06-19 */ public final class XMLReservedChars extends Translator { /** * Converts text to HTML by quoting dangerous characters e.g. " ==> " < ==> < Presumes setEncoding already * done. * * @param raw raw text to be cooked. Must not be null. * * @return translated text */ public String process( String raw ) { assert raw != null : "XMLReservedChars.process raw must not be null"; return EntifyStrings.entifyXML( raw ); } // end process }