Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Release 3.0

Class MassagerRemoveQuotes

  extended by 
All Implemented Interfaces:

public class MassagerRemoveQuotes
extends Object
implements ISystemMassager

Utility class used by UI widgets to format a srcpf or member Description string.
It checks to see if the string is legally quoted, and if not, it returns it as is. A legally quoted string is one which begins and ends with single quotes, and where all single quotes inside the string are escaped with another single quote. If the string is legally quoted, it de-quotes it (hence the name). Dequoting means remove the single quotes, and remove any escape quotes from the inside of the string. There is also a general constructor that takes in the quoting character, the character to escape, and the character to use as an escape charcter. It also takes n a boolean flag that decides wether or not the string has to be quoted before this massager actually does the job.

Constructor Summary
MassagerRemoveQuotes ()
          Default constructor for MassagerRemoveQuotes.
MassagerRemoveQuotes (char quoteChar, char charToEscape, char escapeChar, boolean mustBeQuoted)
          Generic constructor.
Method Summary
protected  boolean isLegalString ( String text)
          Checks to see if we have a valid string.
protected  boolean isQuoted ( String text)
          Returns true if string is single quoted.
  String massage ( String text)
          Given the user-entered input, return the massaged version of it.
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public MassagerRemoveQuotes()
Default constructor for MassagerRemoveQuotes.
Assumes that a legal string is one where the string is quoted with single quotes, and all inner quotes are escaped with a single quote.


public MassagerRemoveQuotes(char quoteChar,
                            char charToEscape,
                            char escapeChar,
                            boolean mustBeQuoted)
Generic constructor. A valid string is one where every charToEscape is actually escaped with an escapeChar before it. If mustBeQuoted is true, then the string is only valid if it is quoted with the quoteChar, and the characters inside the string itself are properly escaped. If the string is determined to be a valid string, this massager returns the string with the quotes and escape characters stripped out. if not, the string is returned as is.

Method Detail


String massage(
String text)
Description copied from interface: ISystemMassager
Given the user-entered input, return the massaged version of it. If no massaging required, return the input as is.

Specified by:
massage in interface ISystemMassager


protected boolean isQuoted(
String text)
Returns true if string is single quoted.


protected boolean isLegalString(
String text)
Checks to see if we have a valid string. A valid string is one where all quotes are escaped with another quote.

Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire