*/
private RepositoryPolicy parseRepositoryPolicy( XmlPullParser parser, boolean strict )
throws IOException, XmlPullParserException
{
String tagName = parser.getName();
RepositoryPolicy repositoryPolicy = new RepositoryPolicy();
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
{
String name = parser.getAttributeName( i );
String value = parser.getAttributeValue( i );
if ( name.indexOf( ':' ) >= 0 )
{
// just ignore attributes with non-default namespace (for example: xmlns:xsi)
}
else
{
checkUnknownAttribute( parser, name, tagName, strict );
}
}
java.util.Set parsed = new java.util.HashSet();
while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
{
if ( checkFieldWithDuplicate( parser, "enabled", null, parsed ) )
{
repositoryPolicy.setEnabled( getBooleanValue( getTrimmedValue( parser.nextText() ), "enabled", parser, "true" ) );
}
else if ( checkFieldWithDuplicate( parser, "updatePolicy", null, parsed ) )
{
repositoryPolicy.setUpdatePolicy( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "checksumPolicy", null, parsed ) )
{
repositoryPolicy.setChecksumPolicy( getTrimmedValue( parser.nextText() ) );
}
else
{
checkUnknownElement( parser, strict );
}