org.eclipse.rse.ui
Class MassagerFoldCaseOutsideQuotes
java.lang.Object
org.eclipse.rse.ui.MassagerFoldCase
org.eclipse.rse.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.
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 java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
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.
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
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.