wro4j-core/src/main/java/ro/isdc/wro/model/group/processor/PreProcessorExecutor.java
public String processAndMerge(final List<Resource> resources, final ProcessingCriteria criteria)
      throws IOException {
    notNull(criteria);
    LOG.debug("criteria: {}", criteria);
    callbackRegistry.onBeforeMerge();
    try {
      notNull(resources);
      LOG.debug("process and merge resources: {}", resources);
      final StringBuffer result = new StringBuffer();
      if (shouldRunInParallel(resources)) {
        result.append(runInParallel(resources, criteria));
      } else {
        for (final Resource resource : resources) {
          LOG.debug("\tmerging resource: {}", resource);
          result.append(applyPreProcessors(resource, criteria));
        }
      }
      return result.toString();
    } finally {
      callbackRegistry.onAfterMerge();
    }
  }
public String processAndMerge(final List<Resource> resources, final ProcessingCriteria criteria)
      throws IOException {
    notNull(criteria);
    LOG.debug("criteria: {}", criteria);
    callbackRegistry.onBeforeMerge();
    try {
      notNull(resources);
      LOG.debug("process and merge resources: {}", resources);
      final StringBuffer result = new StringBuffer();
      if (shouldRunInParallel(resources)) {
        result.append(runInParallel(resources, criteria));
      } else {
        for (final Resource resource : resources) {
          LOG.debug("\tmerging resource: {}", resource);
          result.append(applyPreProcessors(resource, criteria));
        }
      }
      return result.toString();
    } finally {
      callbackRegistry.onAfterMerge();
    }
  }
public String processAndMerge ( final List < Resource > resources , final ProcessingCriteria criteria ) throws IOException { notNull ( criteria ) ; LOG . debug ( "criteria: {}" , criteria ) ; callbackRegistry . onBeforeMerge ( ) ; try { notNull ( resources ) ; LOG . debug ( "process and merge resources: {}" , resources ) ; final StringBuffer result = new StringBuffer ( ) ; if ( shouldRunInParallel ( resources ) ) { result . append ( runInParallel ( resources , criteria ) ) ; } else { for ( final Resource resource : resources ) { LOG . debug ( "\tmerging resource: {}" , resource ) ; result . append ( applyPreProcessors ( resource , criteria ) ) ; } } return result . toString ( ) ; } finally { callbackRegistry . onAfterMerge ( ) ; } }
Apply preProcessors on resources and merge them.

@param resources
what are the resources to merge.
@param criteria
{@link ProcessingCriteria} used to identify the processors to apply and those to skip.
@return preProcessed merged content.
Apply preProcessors on resources and merge them .