* @return Developer
*/
private Developer parseDeveloper( String tagName, XmlPullParser parser, boolean strict )
throws IOException, XmlPullParserException
{
Developer developer = new Developer();
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
{
developer.setId( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
{
developer.setName( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "email", null, parsed ) )
{
developer.setEmail( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
{
developer.setUrl( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "organization", "organisation", parsed ) )
{
developer.setOrganization( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "organizationUrl", "organisationUrl", parsed ) )
{
developer.setOrganizationUrl( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "roles", null, parsed ) )
{
java.util.List roles = new java.util.ArrayList/*<String>*/();
developer.setRoles( roles );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "role" ) )
{
roles.add( getTrimmedValue( parser.nextText() ) );
}
else if ( strict )
{
throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
}
else
{
// swallow up to end tag since this is not valid
while ( parser.next() != XmlPullParser.END_TAG ) {}
}
}
}
else if ( checkFieldWithDuplicate( parser, "timezone", null, parsed ) )
{
developer.setTimezone( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
{
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
String key = parser.getName();
String value = parser.nextText().trim();
developer.addProperty( key, value );
}
}
else
{
if ( strict )