package siprp.planoactuacao.print;

import java.util.Vector;

import org.jdom.Element;

public class LegislacaoAplicavelToPrint
	implements PrintableInterface
{
	protected Vector<String> diplomas;
	
	public LegislacaoAplicavelToPrint( Vector<String> diplomas )
	{
		super();
		this.diplomas = diplomas;
	}
	
	public Vector<String> getDiplomas()
	{
		return diplomas;
	}

	public void setDiplomas( Vector<String> diplomas )
	{
		this.diplomas = diplomas;
	}
	
	protected void addDiploma( String diploma )
	{
		diplomas.add( diploma );
	}

	@Override
	public Element toJdomElement() throws Exception
	{
		Element legislacaoAplicavelElement = new Element( "legislacao-aplicavel" );
		for( String diploma : diplomas )
		{
			Element diplomaElement = new Element( "diploma" );
			diplomaElement.setText( diploma );
			legislacaoAplicavelElement.addContent( diplomaElement );
		}
		return legislacaoAplicavelElement;
	}

}
