/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.model.parser;

import org.eclipse.birt.report.model.api.elements.structures.OdaDataSetParameter;
import org.eclipse.birt.report.model.core.DesignElement;
import org.xml.sax.SAXException;

/**
 * Parses the old data set parameters to new data set parameters list.
 * <p>
 * The conversion is done from the file version 3.2.4. It is a part of automatic
 * conversion for BIRT 2.1.1.
 * 
 */

public class CompatibleDataSetParamListPropertyState extends ListPropertyState
{

	/**
	 * Constructs a <code>CompatibleRenamedPropertyState</code> to parse an
	 * obsolete property.
	 * 
	 * @param theHandler
	 *            the parser handle
	 * @param element
	 *            the element that holds the obsolete property
	 * @param obsoletePropName
	 *            the name of the obsolete property.
	 */

	public CompatibleDataSetParamListPropertyState(
			ModuleParserHandler theHandler, DesignElement element )
	{
		super( theHandler, element );
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.model.parser.ListPropertyState#end()
	 */

	public void end( ) throws SAXException
	{
		for ( int i = 0; i < list.size( ); i++ )
		{
			OdaDataSetParameter param = (OdaDataSetParameter) list.get( i );
			if ( param.getNativeName( ) == null )
				param.setNativeName( param.getName( ) );
		}
		super.end( );
	}
}
