*/
private ModelBase parseModelBase( XmlPullParser parser, boolean strict, InputSource source )
throws IOException, XmlPullParserException
{
String tagName = parser.getName();
ModelBase modelBase = new ModelBase();
InputLocation _location;
_location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
modelBase.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, "modules", null, parsed ) )
{
java.util.List modules = new java.util.ArrayList/*<String>*/();
modelBase.setModules( modules );
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
modelBase.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 ) )
{
modelBase.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
}
else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
{
InputLocation _locations;
_locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
modelBase.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();
modelBase.addProperty( key, value );
}
}
else if ( checkFieldWithDuplicate( parser, "dependencyManagement", null, parsed ) )
{
modelBase.setDependencyManagement( parseDependencyManagement( parser, strict, source ) );
}
else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
{
java.util.List dependencies = new java.util.ArrayList/*<Dependency>*/();
modelBase.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>*/();
modelBase.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>*/();
modelBase.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 );
modelBase.setLocation( "reports", _location );
modelBase.setReports( Xpp3DomBuilder.build( parser ) );
}
else if ( checkFieldWithDuplicate( parser, "reporting", null, parsed ) )
{
modelBase.setReporting( parseReporting( parser, strict, source ) );
}
else
{
checkUnknownElement( parser, strict );
}