158 |
} |
} |
159 |
|
|
160 |
/** |
/** |
|
* Parses a comma separated list whose items are not encapsulated into apostrophes. |
|
|
* @param list The comma separated list. |
|
|
* @return A <code>String</code> array containing all items in the list. |
|
|
* @throws LscpException if the list is broken. |
|
|
*/ |
|
|
protected static String[] |
|
|
parseStringList(String list) throws LscpException { |
|
|
list = removeQuotation(list); |
|
|
return parseList(list); |
|
|
} |
|
|
|
|
|
/** |
|
161 |
* Parses a comma separated string list, which elements contains escaped sequences. |
* Parses a comma separated string list, which elements contains escaped sequences. |
162 |
* @param list The list to parse. |
* @param list The list to parse. |
163 |
* @return A <code>String</code> array containing all items in the list. |
* @return A <code>String</code> array containing all items in the list. |
214 |
* @throws LscpException if the list is broken. |
* @throws LscpException if the list is broken. |
215 |
*/ |
*/ |
216 |
protected static String[] |
protected static String[] |
217 |
parseQuotedStringList(String list) throws LscpException { |
parseStringList(String list) throws LscpException { |
218 |
return parseQuotedStringList(list, ','); |
return parseStringList(list, ','); |
219 |
} |
} |
220 |
|
|
221 |
/** |
/** |
226 |
* @throws LscpException if the list is broken. |
* @throws LscpException if the list is broken. |
227 |
*/ |
*/ |
228 |
protected static String[] |
protected static String[] |
229 |
parseQuotedStringList(String list, char separator) throws LscpException { |
parseStringList(String list, char separator) throws LscpException { |
230 |
if(list == null || list.length() == 0) return new String[0]; |
if(list == null || list.length() == 0) return new String[0]; |
231 |
int q1 = 0, q2 = 0; |
int q1 = 0, q2 = 0; |
232 |
Vector<String> v = new Vector<String>(); |
Vector<String> v = new Vector<String>(); |
257 |
String[][] s2S; |
String[][] s2S; |
258 |
if(!list.startsWith("''") && !list.startsWith("\"\"")) { |
if(!list.startsWith("''") && !list.startsWith("\"\"")) { |
259 |
s2S = new String[1][]; |
s2S = new String[1][]; |
260 |
s2S[0] = parseQuotedStringList(list); |
s2S[0] = parseStringList(list); |
261 |
return s2S; |
return s2S; |
262 |
} |
} |
263 |
|
|
274 |
} |
} |
275 |
|
|
276 |
s2S = new String[v.size()][]; |
s2S = new String[v.size()][]; |
277 |
for(i = 0; i < v.size(); i++) s2S[i] = parseQuotedStringList(v.get(i)); |
for(i = 0; i < v.size(); i++) s2S[i] = parseStringList(v.get(i)); |
278 |
|
|
279 |
return s2S; |
return s2S; |
280 |
} |
} |