org.nuiton.processor
Class ProcessorUtil

java.lang.Object
  extended by org.nuiton.processor.ProcessorUtil

public class ProcessorUtil
extends Object

Utilities methods.

Since:
1.0.0.0
Author:
tchemit

Nested Class Summary
static class ProcessorUtil.FragmentExtractor
          To extract all content inside the header and footer.
static class ProcessorUtil.FragmentRemover
          To remove all content inside the header and footer.
 
Field Summary
static String DEFAULT_ENCODING
          System encoding (use as fall back for deprecated method with no given encoding.
 
Constructor Summary
ProcessorUtil()
           
 
Method Summary
static void doProcess(Processor processor, File in, File out)
          Deprecated. since 1.0.4, prefer use the doProcess(Processor, File, File, String).
static void doProcess(Processor processor, File in, File out, String encoding)
          Launch the process of the given processor to the given files.
static void doProcess(Processor processor, InputStream in, OutputStream out, String encoding)
          Launch the process of the given processor to the given streams.
static void doProcess(Processor processor, InputStreamReader in, OutputStreamWriter out)
          Launch the process of the given processor to the given readers.
static void doProcess(Processor processor, String in, String out)
          Deprecated. since 1.0.4, prefer use the doProcess(Processor, String, String, String).
static void doProcess(Processor processor, String in, String out, String encoding)
          Launch the process of the given processor to the given files.
static Filter[] getFilters(String filters, String separator)
          Instanciate a array of filters given by thier FQN separated by the given separator.
static Processor newProcessor(String filters, String separator)
          Instanciate a new Processor given an array of filters given by their FQN separated by the given separator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
System encoding (use as fall back for deprecated method with no given encoding.

Since:
1.0.4
Constructor Detail

ProcessorUtil

public ProcessorUtil()
Method Detail

newProcessor

public static Processor newProcessor(String filters,
                                     String separator)
                              throws Exception
Instanciate a new Processor given an array of filters given by their FQN separated by the given separator.

Parameters:
filters - the string representionf of the filters
separator - the separator of filter
Returns:
the instanciated processor
Throws:
Exception - if any pb

getFilters

public static Filter[] getFilters(String filters,
                                  String separator)
                           throws Exception
Instanciate a array of filters given by thier FQN separated by the given separator.

Parameters:
filters - the list of filters separated by the given separator
separator - filter separator
Returns:
the array of instanciated filters.
Throws:
Exception - if any pb

doProcess

public static void doProcess(Processor processor,
                             String in,
                             String out,
                             String encoding)
                      throws IOException
Launch the process of the given processor to the given files.

Parameters:
processor - the processor to launch
in - the input file
out - the output file
encoding - encoding to use to read and write files
Throws:
IOException - if any problems while processing file
Since:
1.0.4

doProcess

@Deprecated
public static void doProcess(Processor processor,
                                        String in,
                                        String out)
                      throws IOException
Deprecated. since 1.0.4, prefer use the doProcess(Processor, String, String, String).

Launch the process of the given processor to the given files.

Parameters:
processor - the processor to launch
in - the input file
out - the output file
Throws:
IOException - if any problems while processing file
Since:
1.0.3

doProcess

public static void doProcess(Processor processor,
                             File in,
                             File out,
                             String encoding)
                      throws IOException
Launch the process of the given processor to the given files.

Parameters:
processor - the processor to launch
in - the input file
out - the output file
encoding - encoding to use to read and write files.
Throws:
IOException - if any problems while processing file
Since:
1.0.4

doProcess

public static void doProcess(Processor processor,
                             InputStream in,
                             OutputStream out,
                             String encoding)
                      throws IOException
Launch the process of the given processor to the given streams.

Parameters:
processor - the processor to launch
in - the input file
out - the output file
encoding - encoding to use to read and write files.
Throws:
IOException - if any problems while processing file
Since:
1.1

doProcess

public static void doProcess(Processor processor,
                             InputStreamReader in,
                             OutputStreamWriter out)
                      throws IOException
Launch the process of the given processor to the given readers.

Parameters:
processor - the processor to launch
in - the input file
out - the output file
Throws:
IOException - if any problems while processing file
Since:
1.1

doProcess

@Deprecated
public static void doProcess(Processor processor,
                                        File in,
                                        File out)
                      throws IOException
Deprecated. since 1.0.4, prefer use the doProcess(Processor, File, File, String).

Launch the process of the given processor to the given files using the system default encoding.

Parameters:
processor - the processor to launch
in - the input file
out - the output file
Throws:
IOException - if any problems while processing file
Since:
1.0.3


Copyright © 2002-2011 CodeLutin. All Rights Reserved.