156 |
|
|
157 |
return far; |
return far; |
158 |
} |
} |
|
|
|
159 |
/** |
/** |
160 |
* Parses a comma separated list whose items are encapsulated into apostrophes. |
* Parses a comma separated list whose items are encapsulated into apostrophes. |
|
* |
|
161 |
* @param list The comma separated list. |
* @param list The comma separated list. |
162 |
* @return A <code>String</code> array containing all items in the list. |
* @return A <code>String</code> array containing all items in the list. |
|
* |
|
163 |
* @throws LscpException if the list is broken. |
* @throws LscpException if the list is broken. |
164 |
*/ |
*/ |
165 |
protected static String[] |
protected static String[] |
166 |
parseStringList(String list) throws LscpException { |
parseStringList(String list) throws LscpException { |
167 |
|
return parseStringList(list, ','); |
168 |
|
} |
169 |
|
|
170 |
|
/** |
171 |
|
* Parses a list whose items are encapsulated into apostrophes. |
172 |
|
* @param list The list of strings. |
173 |
|
* @param separator Provides the character used as separator. |
174 |
|
* @return A <code>String</code> array containing all items in the list. |
175 |
|
* @throws LscpException if the list is broken. |
176 |
|
*/ |
177 |
|
protected static String[] |
178 |
|
parseStringList(String list, char separator) throws LscpException { |
179 |
if(list == null || list.length() == 0) return new String[0]; |
if(list == null || list.length() == 0) return new String[0]; |
180 |
int q1 = 0, q2 = 0; |
int q1 = 0, q2 = 0; |
181 |
Vector<String> v = new Vector<String>(); |
Vector<String> v = new Vector<String>(); |
189 |
|
|
190 |
if(q2 + 1 >= list.length()) break; |
if(q2 + 1 >= list.length()) break; |
191 |
|
|
192 |
if(list.charAt(q2 + 1) != ',') |
if(list.charAt(q2 + 1) != separator) |
193 |
throw new LscpException(LscpI18n.getLogMsg("Parser.brokenList!")); |
throw new LscpException(LscpI18n.getLogMsg("Parser.brokenList!")); |
194 |
q1 = q2 + 2; |
q1 = q2 + 2; |
195 |
if(q1 >= list.length()) |
if(q1 >= list.length()) |