Class TextCleaner

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

public class TextCleaner 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

    • TextCleaner

      protected TextCleaner()
  • 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 text)
      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:
      text - Text to sift
      Returns:
      the parameter as is
    • quote

      public String quote(String text)
      Quotes the string passed as parameter to stop browser interpretation. Each character < , \ , ' and " 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:
      text - The string to be quoted
      Returns:
      The quoted version of the string