Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui
Class MassagerRemoveQuotes

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.MassagerRemoveQuotes
All Implemented Interfaces:
ISystemMassager

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.


Field Summary
static String Copyright
           
 
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
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

MassagerRemoveQuotes

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.


MassagerRemoveQuotes

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

massage

public 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

isQuoted

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


isLegalString

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.


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.