Java Reference
In-Depth Information
} catch (SecurityException e) {
throw (new SpiderException(e));
} catch (IllegalAccessException e) {
throw (new SpiderException(e));
} catch (NoSuchFieldException e) {
throw (new SpiderException(e));
}
}
r.close();
f.close();
}
/**
* Process each line of a configuration file.
*
* @param line
* The line of text read from the configuration
* file.
* @throws IllegalArgumentException
* Thrown if an invalid argument is specified.
* @throws SecurityException
* Thrown if a security exception occurs.
* @throws IllegalAccessException
* Thrown if a field cannot be accessed.
* @throws NoSuchFieldException
* Thrown if an invalid field is specified.
*/
@SuppressWarnings("unchecked")
private void parseLine(String line)
throws IllegalArgumentException,
SecurityException, IllegalAccessException,
NoSuchFieldException
{
String name, value;
int i = line.indexOf(':');
if (i == -1) {
return;
}
name = line.substring(0, i).trim();
value = line.substring(i + 1).trim();
if (value.trim().length() == 0) {
value = null;
}
Field field = this.getClass().getField(name);
Search WWH ::




Custom Search