FileDocCategorySizeDatePackage
Transformer.javaAPI DocApache log4j 1.2.152203Sat Aug 25 00:09:34 BST 2007org.apache.log4j.util

Transformer

public class Transformer extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidtransform(java.lang.String in, java.lang.String out, Filter[] filters)


    String line;
    BufferedReader input = new BufferedReader(new FileReader(in));
    PrintStream output = new PrintStream(new FileOutputStream(out, false));
  
    // Initialization of input and output omitted
    while((line = input.readLine()) != null) {
      // apply all filters
      for(int i = 0; i < filters.length; i++) {
	line = filters[i].filter(line);
      }
      if(line != null) {
	output.println(line);
      }
    }
  
public static voidtransform(java.lang.String in, java.lang.String out, Filter filter)


    String line;
    BufferedReader input = new BufferedReader(new FileReader(in));
    PrintStream output = new PrintStream(new FileOutputStream(out));
  
    // Initialization of input and output omitted
    while((line = input.readLine()) != null) {
      line = filter.filter(line);
      output.println(line);
    }