Package com.softwaremining.jcl.utils
Class ParserUtil
java.lang.Object
com.softwaremining.jcl.utils.ParserUtil
Used by JCL modules to parse JCL formats
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
findMatchingCloseBracket
(String str, char openBracket, char closeBracket) static String
removeExtraSpaces
(String data) E.g.static String
removeMatchingBrakets
(String input) Removes the very first matching '(' ...static String
removeSurroundingBrakets
(String input) static String
static String[]
splitCOmmaAndBrakets
(String nextLine) static String[]
splitCOmmaAndBrakets
(String nextLine, boolean removeTerminatingComma) input types: X=Y,A=(B,C),E,F returns new String { "X=Y" , "A=(B,C)" , "E=F"}static String[]
splitTrimmed
(String nextLine) Java's 'String.split' will convert "A B" to 3 tokens "A", " " and "B" This version will generate "A" and "B"
-
Constructor Details
-
ParserUtil
public ParserUtil()
-
-
Method Details
-
splitCOmmaAndBrakets
-
splitCOmmaAndBrakets
input types: X=Y,A=(B,C),E,F returns new String { "X=Y" , "A=(B,C)" , "E=F"}- Parameters:
nextLine
-- Returns:
-
findMatchingCloseBracket
-
removeSurroundingQuotes
-
removeSurroundingBrakets
-
removeExtraSpaces
E.g. Turn " A B C D " into "A B C D"- Parameters:
data
-- Returns:
-
removeMatchingBrakets
Removes the very first matching '(' ... ')' pair from the input string. Only the two parentheses characters are removed; the enclosed text stays intact.- Parameters:
input
- the original string- Returns:
- a new string with the first matching parentheses removed
-
splitTrimmed
Java's 'String.split' will convert "A B" to 3 tokens "A", " " and "B" This version will generate "A" and "B"- Parameters:
nextLine
-- Returns:
-