Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.util.clprompter
Class ClSyntax

java.lang.Object
  extended by com.ibm.etools.iseries.rse.util.clprompter.ClSyntax

public final class ClSyntax
extends Object


Field Summary
static String Copyright
           
 
Constructor Summary
ClSyntax()
           
 
Method Summary
static boolean checkDelimiter(String text, com.ibm.etools.iseries.rse.util.clprompter.ClPanel panel, int type, boolean showError)
          This method is used to verify if there are any delimiters in literals.
static boolean checkExpression(com.ibm.etools.iseries.rse.util.clprompter.ClPanel panel, com.ibm.etools.iseries.rse.util.clprompter.ClCommonLayout cl, String kwd, String text, boolean showError)
          Checks an expression for error conditions.
static void cleanup()
           
static Job getCurrentJob()
           
static String getSpecialChars()
           
static int indexNotInQuote(String textToSearch, String item)
          Searches for the location of the item, so long as it is not in single or double quotes
static int indexNotInQuoteOrBracket(String textToSearch, String item)
          Searches for the specified item in textToSearch, ignoring items in brackets, single or double quotes
protected static boolean isInterpretAsExpression(com.ibm.etools.iseries.rse.util.clprompter.ClCommonLayout cl)
          Determines whether or not the parameter/command combo should interpret a field as an expression by force.
static String quote(int type, String string)
           
static String stripOuterBrackets(String value)
          Strips the outer brackets of a string
static String stripQuotes(String value)
           
static String stripQuotes(String value, boolean stripDouble)
           
static String trim(String text)
          Trims whitespace from the start and end of a string.
 
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

ClSyntax

public ClSyntax()
Method Detail

cleanup

public static void cleanup()

quote

public static final String quote(int type,
                                 String string)
                          throws SystemMessageException
Throws:
SystemMessageException

stripQuotes

public static final String stripQuotes(String value)

stripQuotes

public static final String stripQuotes(String value,
                                       boolean stripDouble)

getSpecialChars

public static String getSpecialChars()

indexNotInQuote

public static int indexNotInQuote(String textToSearch,
                                  String item)
Searches for the location of the item, so long as it is not in single or double quotes

Parameters:
textToSearch - the string to scan
item - the string to find
Returns:
returns the location of the item, -1 if not found
Since:
5.1.2

stripOuterBrackets

public static String stripOuterBrackets(String value)
Strips the outer brackets of a string

Parameters:
value - The string to strip outer brackets from
Returns:
the string without any outer brackets.
Since:
6.0 @V9A

checkExpression

public static boolean checkExpression(com.ibm.etools.iseries.rse.util.clprompter.ClPanel panel,
                                      com.ibm.etools.iseries.rse.util.clprompter.ClCommonLayout cl,
                                      String kwd,
                                      String text,
                                      boolean showError)
                               throws ClSyntaxException
Checks an expression for error conditions.

Parameters:
panel - The panel that the field is on
cl - The common layout that the parameter is using
kwd - The keyword for the parameter.
showError - Whether or not errors should be displayed.
Returns:
True If there is no problems verifying the expression, false otherwise.
Throws:
ClSyntaxException - This exception is thrown if the expression has a syntax error issue.

indexNotInQuoteOrBracket

public static int indexNotInQuoteOrBracket(String textToSearch,
                                           String item)
Searches for the specified item in textToSearch, ignoring items in brackets, single or double quotes

Parameters:
textToSearch - The test to search
item - The item to search for
Returns:
The location of item if found, -1 otherwise.
Since:
6.0 @V9A

trim

public static String trim(String text)
Trims whitespace from the start and end of a string. This method was created because for some reason, String.trim() trims text that isn't whitespace!

Parameters:
text - the text to trim
Returns:
the trimmed text
Since:
6.0 //@VBA

checkDelimiter

public static boolean checkDelimiter(String text,
                                     com.ibm.etools.iseries.rse.util.clprompter.ClPanel panel,
                                     int type,
                                     boolean showError)
                              throws ClSyntaxException
This method is used to verify if there are any delimiters in literals.

Parameters:
text - The text literal to check
panel - The panel to display any messages on
showError - Whether or not errors are to be displayed on the panel.
Returns:
true if there are no invlid delimiters, false if there is some error.
Throws:
ClSyntaxException - If showError is false, then this exception will get thrown instead of an error being displayed.

isInterpretAsExpression

protected static boolean isInterpretAsExpression(com.ibm.etools.iseries.rse.util.clprompter.ClCommonLayout cl)
Determines whether or not the parameter/command combo should interpret a field as an expression by force.

Parameters:
cl - the layout to check
Returns:
true if the text for the parameter/command should be interpreted by default as an expresison, false otherwise.

getCurrentJob

public static Job getCurrentJob()

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 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.