{
List enhancerElemList = new ArrayList();
int timeCovCount = 0;
for ( Iterator it = enhancerList.iterator(); it.hasNext(); )
{
DatasetEnhancer curEnhancer = (DatasetEnhancer) it.next();
if ( curEnhancer instanceof RegExpAndDurationTimeCoverageEnhancer )
{
if ( timeCovCount > 0 )
{
logger.warn( "writeDatasetScanEnhancer(): More than one addTimeCoverage element, skipping.");
continue;
}
timeCovCount++;
Element timeCovElem = new Element( "addTimeCoverage", defNS );
RegExpAndDurationTimeCoverageEnhancer timeCovEnhancer = (RegExpAndDurationTimeCoverageEnhancer) curEnhancer;
timeCovElem.setAttribute( "datasetNameMatchPattern", timeCovEnhancer.getMatchPattern() );
timeCovElem.setAttribute( "startTimeSubstitutionPattern", timeCovEnhancer.getSubstitutionPattern() );
timeCovElem.setAttribute( "duration", timeCovEnhancer.getDuration() );
enhancerElemList.add( timeCovElem );
}
else
{
enhancerElemList.add( writeDatasetScanUserDefined( "datasetEnhancerImpl", curEnhancer.getClass().getName(), curEnhancer.getConfigObject() ) );
}
}
return enhancerElemList;
}