RSE
Release 3.4

org.eclipse.rse.ui
Class MassagerFoldCaseOutsideQuotes

java.lang.Object
  extended by org.eclipse.rse.ui.MassagerFoldCase
      extended by 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.


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 org.eclipse.rse.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
 

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


RSE
Release 3.4

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