* @return BuildBase
*/
private BuildBase parseBuildBase( String tagName, XmlPullParser parser, boolean strict )
throws IOException, XmlPullParserException
{
BuildBase buildBase = new BuildBase();
java.util.Set parsed = new java.util.HashSet();
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( checkFieldWithDuplicate( parser, "defaultGoal", null, parsed ) )
{
buildBase.setDefaultGoal( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "resources", null, parsed ) )
{
java.util.List resources = new java.util.ArrayList/*<Resource>*/();
buildBase.setResources( resources );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "resource" ) )
{
resources.add( parseResource( "resource", parser, strict ) );
}
else if ( strict )
{
throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
}
else
{
// swallow up to end tag since this is not valid
while ( parser.next() != XmlPullParser.END_TAG ) {}
}
}
}
else if ( checkFieldWithDuplicate( parser, "testResources", null, parsed ) )
{
java.util.List testResources = new java.util.ArrayList/*<Resource>*/();
buildBase.setTestResources( testResources );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "testResource" ) )
{
testResources.add( parseResource( "testResource", parser, strict ) );
}
else if ( strict )
{
throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
}
else
{
// swallow up to end tag since this is not valid
while ( parser.next() != XmlPullParser.END_TAG ) {}
}
}
}
else if ( checkFieldWithDuplicate( parser, "directory", null, parsed ) )
{
buildBase.setDirectory( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "finalName", null, parsed ) )
{
buildBase.setFinalName( getTrimmedValue( parser.nextText() ) );
}
else if ( checkFieldWithDuplicate( parser, "filters", null, parsed ) )
{
java.util.List filters = new java.util.ArrayList/*<String>*/();
buildBase.setFilters( filters );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "filter" ) )
{
filters.add( getTrimmedValue( parser.nextText() ) );
}
else if ( strict )
{
throw new XmlPullParserException( "Unrecognised association: '" + parser.getName() + "'", parser, null );
}
else
{
// swallow up to end tag since this is not valid
while ( parser.next() != XmlPullParser.END_TAG ) {}
}
}
}
else if ( checkFieldWithDuplicate( parser, "pluginManagement", null, parsed ) )
{
buildBase.setPluginManagement( parsePluginManagement( "pluginManagement", parser, strict ) );
}
else if ( checkFieldWithDuplicate( parser, "plugins", null, parsed ) )
{
java.util.List plugins = new java.util.ArrayList/*<Plugin>*/();
buildBase.setPlugins( plugins );
while ( parser.nextTag() == XmlPullParser.START_TAG )
{
if ( parser.getName().equals( "plugin" ) )
{
plugins.add( parsePlugin( "plugin", parser, strict ) );