public function processar()
{
if (method_exists($this, 'init')) {
$this->init();
}
foreach ($this->file as $linha) {
$inicio = $this->rem(1, 1, $linha);
if ($inicio == '0') {
$this->processarHeader($linha);
} else {
if ($inicio == '9') {
$this->processarTrailer($linha);
} else {
$this->incrementDetalhe();
if ($this->processarDetalhe($linha) === false) {
unset($this->detalhe[$this->increment]);
$this->increment--;
}
}
}
}
if (method_exists($this, 'finalize')) {
$this->finalize();
}
return $this;
}