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;
	protected boolean generico;
	
	public PostoToPrint( String designacao, Vector<RiscoToPrint> riscos, boolean generico )
	{
		this.designacao = designacao;
		this.riscos = riscos;
		this.generico = generico;
	}

	@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;
	}
	
	public boolean isGenerico()
	{
		return generico;
	}
}
