Remote Systems
v6.4.1

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

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

public class MassagerFoldCaseOutsideQuotes
extends MassagerFoldCase

This massager folds the input text into either uppercase or lowercase, but ONLY for those portions of the string that are not inside delimiters.

The default delimiter characters checked for are single or double quote characters, but this can be changed by a setter method. When any of the delimiter characters are first found we enter delimited (non-folding) mode, until the same non-escaped delimiter character is found.

This massager assumes an imbedded delimiter is denoted by a doubled up delimiter. If this is not the case, a setter can be used for the escape character.

This massager takes more time than the MassageFoldCaseUnlessQuoted massager, as that one just checks if the entire string is delimited, while this one attempts to check for ranges of delimiting.


Field Summary
static String Copyright
           
 
Constructor Summary
MassagerFoldCaseOutsideQuotes()
          Constructor using uppercase and using single and double quotes as delimiters
MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase)
          Constructor using given case direction, using single and double quotes as delimiters
MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase, char[] delimiters)
          Constructor using given case direction, using given delimiters
 
Method Summary
protected  String doFolding(String input, boolean upperCase)
          Method that actually walks the given string, character by character, folding all those which are not inside delimiters
 char[] getDelimiters()
          Get the delimiter characters
 char getEscapeCharacter()
          Get the escape character
protected  boolean hasAnyDelimiters(String input)
          Check for existence of any delimiters
protected  boolean isDelimiter(char currChar)
          Check if given character is one of the delimiters
 void setDelimiters(char[] delimiters)
          Set the delimiter characters
 void setEscapeCharacter(char escapeChar)
          Set the escape character used for denoted an imbedded delimiter.
protected  String toLowerCase(String input)
          Overrridable method that actually does the lowercasing
protected  String toUpperCase(String input)
          Overrridable method that actually does the uppercasing
 
Methods inherited from class com.ibm.etools.systems.core.ui.MassagerFoldCase
getFoldToUpperCase, getTrimBlanks, massage, setFoldToUpperCase, setTrimBlanks
 
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

MassagerFoldCaseOutsideQuotes

public MassagerFoldCaseOutsideQuotes()
Constructor using uppercase and using single and double quotes as delimiters


MassagerFoldCaseOutsideQuotes

public MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase)
Constructor using given case direction, using single and double quotes as delimiters

Parameters:
foldToUpperCase - - whether to fold to uppercase (true) or lowercase (false).

MassagerFoldCaseOutsideQuotes

public MassagerFoldCaseOutsideQuotes(boolean foldToUpperCase,
                                     char[] delimiters)
Constructor using given case direction, using given delimiters

Parameters:
foldToUpperCase - - whether to fold to uppercase (true) or lowercase (false).
delimiters - - chars to trigger delimited mode. Delimited sections are not folded.
Method Detail

setDelimiters

public void setDelimiters(char[] delimiters)
Set the delimiter characters

Parameters:
delimiters - - chars to trigger delimited mode. Delimited sections are not folded.

setEscapeCharacter

public void setEscapeCharacter(char escapeChar)
Set the escape character used for denoted an imbedded delimiter. By default, it is assumed a doubled up delimiter is used for this.

Parameters:
escapeChar - - char that escapes the delimiter. Eg '\'

getDelimiters

public char[] getDelimiters()
Get the delimiter characters


getEscapeCharacter

public char getEscapeCharacter()
Get the escape character


toUpperCase

protected String toUpperCase(String input)
Overrridable method that actually does the uppercasing

Overrides:
toUpperCase in class MassagerFoldCase

toLowerCase

protected String toLowerCase(String input)
Overrridable method that actually does the lowercasing

Overrides:
toLowerCase in class MassagerFoldCase

hasAnyDelimiters

protected boolean hasAnyDelimiters(String input)
Check for existence of any delimiters


doFolding

protected String doFolding(String input,
                           boolean upperCase)
Method that actually walks the given string, character by character, folding all those which are not inside delimiters


isDelimiter

protected boolean isDelimiter(char currChar)
Check if given character is one of the delimiters


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.