* @param parser
*/
private License parseLicense(String tagName, XmlPullParser parser, boolean strict, String encoding)
throws IOException, XmlPullParserException
{
License license = new License();
license.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "name" ) )
{
if ( parsed.contains( "name" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "name" );
license.setName( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "url" ) )
{
if ( parsed.contains( "url" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "url" );
license.setUrl( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "distribution" ) )
{
if ( parsed.contains( "distribution" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "distribution" );
license.setDistribution( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "comments" ) )
{
if ( parsed.contains( "comments" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "comments" );
license.setComments( getTrimmedValue( parser.nextText()) );
}
else
{
if ( strict )
{