private Profile parseProfile( XmlPullParser parser, boolean strict, InputSource source )
throws IOException, XmlPullParserException
{
String tagName = parser.getName();
Profile profile = new Profile();
InputLocation _location;
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
profile.setLocation( "", _location );
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, "id", null, parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
profile.setLocation( "id", _location );
profile.setId( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "activation", null, parsed ) )
{
profile.setActivation( parseActivation( parser, strict, source ) );
}
else if ( checkFieldWithDuplicate( parser, "build", null, parsed ) )
{
profile.setBuild( parseBuildBase( parser, strict, source ) );
}
else if ( checkFieldWithDuplicate( parser, "modules", null, parsed ) )
{
java.util.List modules = new java.util.ArrayList/*<String>*/();
profile.setModules( modules );
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
profile.setLocation( "modules", _locations );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( "module".equals( parser.getName() ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
_locations.setLocation( Integer.valueOf( modules.size() ), _location );
modules.add( getTrimmedValue( parser.nextText() ) );
}
else
{
checkUnknownElement( parser, strict );
}
}
}
else if ( checkFieldWithDuplicate( parser, "distributionManagement", null, parsed ) )
{
profile.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
}
else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
{
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
profile.setLocation( "properties", _locations );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
String key = parser.getName();
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
_locations.setLocation( key, _location );
String value = parser.nextText().trim();
profile.addProperty( key, value );
}
}
else if ( checkFieldWithDuplicate( parser, "dependencyManagement", null, parsed ) )
{
profile.setDependencyManagement( parseDependencyManagement( parser, strict, source ) );
}
else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
{
java.util.List dependencies = new java.util.ArrayList/*<Dependency>*/();
profile.setDependencies( dependencies );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( "dependency".equals( parser.getName() ) )
{
dependencies.add( parseDependency( parser, strict, source ) );
}
else
{
checkUnknownElement( parser, strict );
}
}
}
else if ( checkFieldWithDuplicate( parser, "repositories", null, parsed ) )
{
java.util.List repositories = new java.util.ArrayList/*<Repository>*/();
profile.setRepositories( repositories );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( "repository".equals( parser.getName() ) )
{
repositories.add( parseRepository( parser, strict, source ) );
}
else
{
checkUnknownElement( parser, strict );
}
}
}
else if ( checkFieldWithDuplicate( parser, "pluginRepositories", null, parsed ) )
{
java.util.List pluginRepositories = new java.util.ArrayList/*<Repository>*/();
profile.setPluginRepositories( pluginRepositories );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( "pluginRepository".equals( parser.getName() ) )
{
pluginRepositories.add( parseRepository( parser, strict, source ) );
}
else
{
checkUnknownElement( parser, strict );
}
}
}
else if ( checkFieldWithDuplicate( parser, "reports", null, parsed ) )
{
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
profile.setLocation( "reports", _location );
profile.setReports( Xpp3DomBuilder.build( parser ) );
}
else if ( checkFieldWithDuplicate( parser, "reporting", null, parsed ) )
{