* @param xml The xml containing the configuration.
* @return The service configuration.
* @throws ApsSystemException In case of parsing errors.
*/
public AvatarConfig extractConfig(String xml) throws ApsSystemException {
AvatarConfig config = new AvatarConfig();
Element root = this.getRootElement(xml);
Element styleElem = root.getChild(STYLE_ELEM);
String style = null;
if (styleElem != null) {
style = styleElem.getText();
}
if (StringUtils.isBlank(style) || !ArrayUtils.contains(AvatarConfig.STYLES, style)) {
style = AvatarConfig.STYLE_LOCAL;
}
config.setStyle(style);
return config;
}