* @param parser
*/
private ModelBase parseModelBase(String tagName, XmlPullParser parser, boolean strict, String encoding)
throws IOException, XmlPullParserException
{
ModelBase modelBase = new ModelBase();
modelBase.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "modules" ) )
{
if ( parsed.contains( "modules" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "modules" );
java.util.List modules = new java.util.ArrayList();
modelBase.setModules( modules );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "module" ) )
{
modules.add( getTrimmedValue( parser.nextText()) );
}
else
{
parser.nextText();
}
}
}
else if ( parser.getName().equals( "repositories" ) )
{
if ( parsed.contains( "repositories" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "repositories" );
java.util.List repositories = new java.util.ArrayList();
modelBase.setRepositories( repositories );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "repository" ) )
{
repositories.add( parseRepository( "repository", parser, strict, encoding ) );
}
else
{
parser.nextText();
}
}
}
else if ( parser.getName().equals( "pluginRepositories" ) )
{
if ( parsed.contains( "pluginRepositories" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "pluginRepositories" );
java.util.List pluginRepositories = new java.util.ArrayList();
modelBase.setPluginRepositories( pluginRepositories );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "pluginRepository" ) )
{
pluginRepositories.add( parseRepository( "pluginRepository", parser, strict, encoding ) );
}
else
{
parser.nextText();
}
}
}
else if ( parser.getName().equals( "dependencies" ) )
{
if ( parsed.contains( "dependencies" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "dependencies" );
java.util.List dependencies = new java.util.ArrayList();
modelBase.setDependencies( dependencies );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "dependency" ) )
{
dependencies.add( parseDependency( "dependency", parser, strict, encoding ) );
}
else
{
parser.nextText();
}
}
}
else if ( parser.getName().equals( "reports" ) )
{
if ( parsed.contains( "reports" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "reports" );
modelBase.setReports( Xpp3DomBuilder.build( parser ) );
}
else if ( parser.getName().equals( "reporting" ) )
{
if ( parsed.contains( "reporting" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "reporting" );
modelBase.setReporting( parseReporting( "reporting", parser, strict, encoding ) );
}
else if ( parser.getName().equals( "dependencyManagement" ) )
{
if ( parsed.contains( "dependencyManagement" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "dependencyManagement" );
modelBase.setDependencyManagement( parseDependencyManagement( "dependencyManagement", parser, strict, encoding ) );
}
else if ( parser.getName().equals( "distributionManagement" ) )
{
if ( parsed.contains( "distributionManagement" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "distributionManagement" );
modelBase.setDistributionManagement( parseDistributionManagement( "distributionManagement", parser, strict, encoding ) );
}
else if ( parser.getName().equals( "properties" ) )
{
if ( parsed.contains( "properties" ) )
{
throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
}
parsed.add( "properties" );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
String key = parser.getName();
String value = parser.nextText()
.trim()
;
modelBase.addProperty( key, value );
}
}
else
{
if ( strict )