package siprp.higiene.relatorio.print;

import java.util.Vector;

import org.jdom.Element;


public class PostoToPrint
	implements PrintableInterface
{
	protected String designacao;
	protected Vector<RiscoToPrint> riscos;
	
	public PostoToPrint( String designacao, Vector<RiscoToPrint> riscos )
	{
		this.designacao = designacao;
		this.riscos = riscos;
	}

	@Override
	public Element toJdomElement()
		throws Exception
	{
		Element postoElement = new Element( "posto" );
		Element designacaoElement = new Element( "designacao" );
		designacaoElement.setText( designacao );
		postoElement.addContent( designacaoElement );
		for( RiscoToPrint risco : riscos )
		{
			postoElement.addContent( risco.toJdomElement() );
		}
		return postoElement;
	}
}
