public boolean hasNext( StudioProgressMonitor monitor )
{
if ( containerList.isEmpty() )
{
LdifFile model = new LdifFile();
// parse header
if ( !headerParsed )
{
checkAndParseComment( model );
checkAndParseVersion( model );
checkAndParseComment( model );
headerParsed = true;
}
// parse body (in a loop)
if ( headerParsed && !bodyParsed )
{
// parse comment lines
if ( !checkAndParseComment( model ) )
{
// parse record
if ( !checkAndParseRecord( model ) )
{
// parse unknown
if ( !checkAndParseOther( model ) )
{
// end of body
bodyParsed = true;
}
}
}
}
// parse footer
if ( headerParsed && bodyParsed && !footerParsed )
{
checkAndParseComment( model );
footerParsed = true;
}
LdifContainer[] containers = model.getContainers();
this.containerList.addAll( Arrays.asList( containers ) );
return !containerList.isEmpty() && !( containers[0] instanceof LdifEOFContainer );
}
else