*/
private Mirror parseMirror( XmlPullParser parser, boolean strict )
throws IOException, XmlPullParserException
{
String tagName = parser.getName();
Mirror mirror = new Mirror();
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, "mirrorOf", null, parsed ) )
{
mirror.setMirrorOf( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
{
mirror.setName( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
{
mirror.setUrl( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
{
mirror.setLayout( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "mirrorOfLayouts", null, parsed ) )
{
mirror.setMirrorOfLayouts( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
{
mirror.setId( getTrimmedValue( parser.nextText() ) );
}
else
{
checkUnknownElement( parser, strict );
}