Class XmlCleaner

java.lang.Object
overit.geocall.ui.cleaner.Cleaner
overit.geocall.ui.cleaner.XmlCleaner
All Implemented Interfaces:
Serializable

public class XmlCleaner extends Cleaner
This class implements the Cleaner object that performs the strongest type of sanitization, ie the one that considers the whole text as simple plain text. Any formatting or html code, whether active or passive, will not be considered and therefore will have no effect.
See Also:
  • Constructor Details

    • XmlCleaner

      protected XmlCleaner()
  • Method Details

    • safeCopy

      public Cleaner safeCopy()
      Returns the instance of TextCleaner in fact the cleaning methodology of this kind of Cleaner is thread safe
      Specified by:
      safeCopy in class Cleaner
      Returns:
      The instance of the object
    • sift

      public String sift(String xml)
      The string is returned as is, beacuse there's no need to sift the string. All the work is done quoting symbols
      Specified by:
      sift in class Cleaner
      Parameters:
      xml - the string representing the xml
      Returns:
      the parameter as is
    • quote

      public String quote(String xml)
      Quotes the string passed as parameter to stop browser interpretation. Each character &,<,> is quoted, that is, replaced with the corresponding html number; in this way these characters are considered as simple characters and put on screen as they are, and are not treated as html code.
      This allows avoiding the insertion of any malicious active html code.
      Specified by:
      quote in class Cleaner
      Parameters:
      xml - The string to be sanitized
      Returns:
      The sanitized version of the string