* @return Versioning
*/
private Versioning parseVersioning( String tagName, XmlPullParser parser, boolean strict )
throws IOException, XmlPullParserException
{
Versioning versioning = new Versioning();
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( checkFieldWithDuplicate( parser, "latest", null, parsed ) )
{
versioning.setLatest( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "release", null, parsed ) )
{
versioning.setRelease( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "snapshot", null, parsed ) )
{
versioning.setSnapshot( parseSnapshot( "snapshot", parser, strict ) );
}
else if ( checkFieldWithDuplicate( parser, "versions", null, parsed ) )
{
java.util.List versions = new java.util.ArrayList/*<String>*/();
versioning.setVersions( versions );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "version" ) )
{
versions.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, "lastUpdated", null, parsed ) )
{
versioning.setLastUpdated( getTrimmedValue( parser.nextText() ) );
}
else
{
if ( strict )
{