* @param parser
*/
private RepositoryPolicy parseRepositoryPolicy(String tagName, XmlPullParser parser, boolean strict, String encoding)
throws IOException, XmlPullParserException
{
RepositoryPolicy repositoryPolicy = new RepositoryPolicy();
repositoryPolicy.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "enabled" ) )
{
if ( parsed.contains( "enabled" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "enabled" );
repositoryPolicy.setEnabled( getBooleanValue( getTrimmedValue( parser.nextText()), "enabled", parser ) );
}
else if ( parser.getName().equals( "updatePolicy" ) )
{
if ( parsed.contains( "updatePolicy" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "updatePolicy" );
repositoryPolicy.setUpdatePolicy( getTrimmedValue( parser.nextText()) );
}
else if ( parser.getName().equals( "checksumPolicy" ) )
{
if ( parsed.contains( "checksumPolicy" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "checksumPolicy" );
repositoryPolicy.setChecksumPolicy( getTrimmedValue( parser.nextText()) );
}
else
{
if ( strict )
{