/*
 * Copyright (c) 2008. All rights reserved.
 */
package ro.isdc.wro.processor;

import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

import ro.isdc.wro.resource.Resource;


/**
 * ResourcePreProcessor. A processor which will be applied to the resource before merging. TODO: maybe it would be a
 * good idea to have List<ResourceType> support() method used to identify the type of resources this should apply on?
 *
 * @author Alex Objelean
 * @created Created on Nov 19, 2008
 */
public interface ResourcePreProcessor {
  /**
   * Process a content supplied by a reader and perform some sort of processing.
   *
   * @param resource
   *          the original resource as it found in the model.
   * @param reader
   *          {@link Reader} used to read original resource content.
   * @param writer
   *          {@link Writer} where used to write processed results.
   * @throws IOException
   *           when IO exception occurs.
   */
  public void process(final Resource resource, final Reader reader,
      final Writer writer) throws IOException;
}

@@ -1,11 +1,10 @@
 /*
-%0D
 %0A * Copy
@@ -39,22 +39,20 @@
 eserved.
-%0D
 %0A */
-%0D
 %0Apackage
@@ -74,19 +74,17 @@
 ocessor;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -103,17 +103,16 @@
 ception;
-%0D
 %0Aimport 
@@ -126,17 +126,16 @@
 .Reader;
-%0D
 %0Aimport 
@@ -149,19 +149,17 @@
 .Writer;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -192,18 +192,14 @@
 rce;
-%0D%0A%0D%0A%0D
+%0A%0A
 %0A/**
-%0D
 %0A * 
@@ -311,17 +311,16 @@
 uld be a
-%0D
 %0A * good
@@ -433,13 +433,11 @@
  on?
-%0D
 %0A *
-%0D
 %0A * 
@@ -457,17 +457,16 @@
 Objelean
-%0D
 %0A * @cre
@@ -497,14 +497,12 @@
 2008
-%0D
 %0A */
-%0D
 %0Apub
@@ -541,16 +541,124 @@
 or %7B
-%0D
+%0A  //TODO add a closure responsible for applying preprocessor on new resources instead of modifying the model.
 %0A  /**
-%0D
 %0A   
@@ -738,15 +738,13 @@
 ing.
-%0D
 %0A   *
-%0D
 %0A   
@@ -760,17 +760,16 @@
 resource
-%0D
 %0A   *   
@@ -822,17 +822,16 @@
 e model.
-%0D
 %0A   * @p
@@ -841,17 +841,16 @@
 m reader
-%0D
 %0A   *   
@@ -910,17 +910,16 @@
 content.
-%0D
 %0A   * @p
@@ -929,17 +929,16 @@
 m writer
-%0D
 %0A   *   
@@ -997,17 +997,16 @@
 results.
-%0D
 %0A   * @t
@@ -1022,17 +1022,16 @@
 xception
-%0D
 %0A   *   
@@ -1067,16 +1067,14 @@
 urs.
-%0D
 %0A   */
-%0D
 %0A  p
@@ -1137,17 +1137,16 @@
  reader,
-%0D
 %0A      f
@@ -1188,9 +1188,7 @@
 ion;
-%0D
 %0A%7D
-%0D
 %0A

add a TODO about some refactoring