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
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

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

  




 

 

RSE
Release 3.0

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.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