*/
private Developer parseDeveloper( XmlPullParser parser, boolean strict, InputSource source )
throws IOException, XmlPullParserException
{
String tagName = parser.getName();
Developer developer = new Developer();
InputLocation _location;
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "", _location );
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
{
String name = parser.getAttributeName( i );
String value = parser.getAttributeValue( i );
if ( name.indexOf( ':' ) >= 0 )
{
// just ignore attributes with non-default namespace (for example: xmlns:xsi)
}
else
{
checkUnknownAttribute( parser, name, tagName, strict );
}
}
java.util.Set parsed = new java.util.HashSet();
while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
{
if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "id", _location );
developer.setId( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "name", _location );
developer.setName( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "email", null, parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "email", _location );
developer.setEmail( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "url", _location );
developer.setUrl( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "organization", "organisation", parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "organization", _location );
developer.setOrganization( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "organizationUrl", "organisationUrl", parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "organizationUrl", _location );
developer.setOrganizationUrl( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "roles", null, parsed ) )
{
java.util.List roles = new java.util.ArrayList/*<String>*/();
developer.setRoles( roles );
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "roles", _locations );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( "role".equals( parser.getName() ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
_locations.setLocation( Integer.valueOf( roles.size() ), _location );
roles.add( getTrimmedValue( parser.nextText() ) );
}
else
{
checkUnknownElement( parser, strict );
}
}
}
else if ( checkFieldWithDuplicate( parser, "timezone", null, parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "timezone", _location );
developer.setTimezone( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
{
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
developer.setLocation( "properties", _locations );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
String key = parser.getName();
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
_locations.setLocation( key, _location );
String value = parser.nextText().trim();
developer.addProperty( key, value );
}
}
else
{
checkUnknownElement( parser, strict );