* @param parser
*/
private Versioning parseVersioning(String tagName, XmlPullParser parser, boolean strict, String encoding)
throws IOException, XmlPullParserException
{
Versioning versioning = new Versioning();
versioning.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "latest" ) )
{
if ( parsed.contains( "latest" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "latest" );
versioning.setLatest( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "release" ) )
{
if ( parsed.contains( "release" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "release" );
versioning.setRelease( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "snapshot" ) )
{
if ( parsed.contains( "snapshot" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "snapshot" );
versioning.setSnapshot( parseSnapshot( "snapshot", parser, strict, encoding ) );
}
else if ( parser.getName().equals( "versions" ) )
{
if ( parsed.contains( "versions" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "versions" );
java.util.List versions = new java.util.ArrayList();
versioning.setVersions( versions );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "version" ) )
{
versions.add( getTrimmedValue( parser.nextText()) );
}
else
{
parser.nextText();
}
}
}
else if ( parser.getName().equals( "lastUpdated" ) )
{
if ( parsed.contains( "lastUpdated" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "lastUpdated" );
versioning.setLastUpdated( getTrimmedValue( parser.nextText()) );
}
else
{
if ( strict )
{