result = (StringParser) Class.forName(classname).newInstance();
} else {
result = (StringParser) Class.forName("com.martiansoftware.jsap.stringparsers." + classname).newInstance();
}
if ((properties != null) && (properties.size() > 0)) {
PropertyStringParser p = (PropertyStringParser) result;
for (Iterator i = properties.iterator(); i.hasNext(); ) {
Property property = (Property) i.next();
p.setProperty(property.getName(), property.getValue());
}
}
return (result);
} catch (Throwable t) {
throw (new RuntimeException("Unable to create StringParser " + classname + ": " + t.getMessage(), t));