* @param xmlStreamReader
*/
private BuildBase parseBuildBase(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
throws IOException, XMLStreamException
{
BuildBase buildBase = new BuildBase();
buildBase.setModelEncoding( encoding );
java.util.Set parsed = new java.util.HashSet();
while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
{
if ( xmlStreamReader.getLocalName().equals( "defaultGoal" ) )
{
if ( parsed.contains( "defaultGoal" ) )
{
throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
}
parsed.add( "defaultGoal" );
buildBase.setDefaultGoal( getTrimmedValue( xmlStreamReader.getElementText()) );
}
else if ( xmlStreamReader.getLocalName().equals( "resources" ) )
{
if ( parsed.contains( "resources" ) )
{
throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
}
parsed.add( "resources" );
java.util.List resources = new java.util.ArrayList();
buildBase.setResources( resources );
while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
{
if ( xmlStreamReader.getLocalName().equals( "resource" ) )
{
buildBase.addResource( parseResource( "resource", xmlStreamReader, strict, encoding ) );
}
else
{
throw new XMLStreamException( "Unrecognised tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
}