{
foundRoot = true;
}
else if ( strict && ! foundRoot )
{
throw new XmlPullParserException( "Expected root element '" + tagName + "' but found '" + parser.getName() + "'", parser, null );
}
else if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
{
metadata.setGroupId( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
{
metadata.setArtifactId( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
{
metadata.setVersion( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "versioning", null, parsed ) )
{
metadata.setVersioning( parseVersioning( "versioning", parser, strict ) );
}
else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
{
java.util.List plugins = new java.util.ArrayList/*<Plugin>*/();
metadata.setPlugins( plugins );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "plugin" ) )
{
plugins.add( parsePlugin( "plugin", parser, strict ) );
}
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 ( strict )
{
throw new XmlPullParserException( "Unrecognised tag: '" + parser.getName() + "'", parser, null );
}
}
eventType = parser.next();
}
return metadata;