public class SplitString extends Object
Constructor and Description |
---|
SplitString() |
Modifier and Type | Method and Description |
---|---|
protected static int |
findClosingQuote(String s,
char quote,
int index,
int len) |
protected static boolean |
isQuote(char c) |
static void |
main(String[] args) |
protected static void |
putPair(Map<String,String> map,
String arg) |
static List<String> |
splitCommandLine(String commandLine)
Split a command line into single parts, respecting quoted
arguments.
|
static Map<String,String> |
splitMacroOptions(String options)
Split a macro-type option string into single parts, respecting brackets.
|
public static List<String> splitCommandLine(String commandLine) throws ParseException
ParseException
protected static int findClosingQuote(String s, char quote, int index, int len) throws ParseException
ParseException
protected static boolean isQuote(char c)
public static Map<String,String> splitMacroOptions(String options) throws ParseException
Example:
path=[C:\Documents and Settings\ImageJ\Desktop\My Beautiful Image.jpg] radius=5
would be split into the two parts
path -> C:\Documents and Settings\ImageJ\Desktop\My Beautiful Image.jpg radius -> 5
In other words, it splits by white space, however it keeps arguments intact that are enclosed in brackets.
ParseException
protected static void putPair(Map<String,String> map, String arg) throws ParseException
ParseException
public static void main(String[] args)
Copyright © 2015–2021 Fiji. All rights reserved.