org.netbeans.modules.extexecution/2 1.25.1

org.netbeans.api.extexecution.input
Class InputProcessors

java.lang.Object
  extended by org.netbeans.api.extexecution.input.InputProcessors

public final class InputProcessors
extends Object

Factory methods for InputProcessor classes.


Method Summary
static InputProcessor ansiStripping(InputProcessor delegate)
          Returns the processor that strips any ANSI escape sequences and passes the result to the delegate.
static InputProcessor bridge(LineProcessor lineProcessor)
          Returns the processor converting characters to the whole lines passing them to the given line processor.
static InputProcessor copying(Writer writer)
          Returns the processor that writes every character passed for processing to the given writer.
static InputProcessor printing(OutputWriter out, boolean resetEnabled)
          Returns the processor printing all characters passed for processing to the given output writer.
static InputProcessor printing(OutputWriter out, LineConvertor convertor, boolean resetEnabled)
          Returns the processor converting whole lines with convertor and printing the result including unterminated tail (if present) to the given output writer.
static InputProcessor proxy(InputProcessor... processors)
          Returns the processor acting as a proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bridge

@NonNull
public static InputProcessor bridge(@NonNull
                                            LineProcessor lineProcessor)
Returns the processor converting characters to the whole lines passing them to the given line processor.

Any reset or close is delegated to the corresponding method of line processor.

Returned processor is not thread safe.

Parameters:
lineProcessor - processor consuming parsed lines
Returns:
the processor converting characters to the whole lines

proxy

@NonNull
public static InputProcessor proxy(@NonNull
                                           InputProcessor... processors)
Returns the processor acting as a proxy.

Any action taken on this processor is distributed to all processors passed as arguments in the same order as they were passed to this method.

Returned processor is not thread safe.

Parameters:
processors - processor to which the actions will be ditributed
Returns:
the processor acting as a proxy

copying

@NonNull
public static InputProcessor copying(@NonNull
                                             Writer writer)
Returns the processor that writes every character passed for processing to the given writer.

Reset action on the returned processor is noop. Processor closes the writer on InputProcessor.close().

Returned processor is not thread safe.

Parameters:
writer - processed characters will be written to this writer
Returns:
the processor that writes every character passed for processing to the given writer

printing

@NonNull
public static InputProcessor printing(@NonNull
                                              OutputWriter out,
                                              boolean resetEnabled)
Returns the processor printing all characters passed for processing to the given output writer.

Reset action on the returned processor resets the writer if it is enabled by passing true as resetEnabled. Processor closes the output writer on InputProcessor.close().

Returned processor is not thread safe.

Parameters:
out - where to print received characters
resetEnabled - determines whether the reset operation will work (will reset the writer if so)
Returns:
the processor printing all characters passed for processing to the given output writer

printing

@NonNull
public static InputProcessor printing(@NonNull
                                              OutputWriter out,
                                              @NullAllowed
                                              LineConvertor convertor,
                                              boolean resetEnabled)
Returns the processor converting whole lines with convertor and printing the result including unterminated tail (if present) to the given output writer. If the covertor does not handle line passed to it (returning null) raw lines are printed.

Reset action on the returned processor resets the writer if it is enabled by passing true as resetEnabled. Processor closes the output writer on InputProcessor.close().

Returned processor is not thread safe.

Parameters:
out - where to print converted lines and characters
convertor - convertor converting the whole lines before printing, may be null
resetEnabled - determines whether the reset operation will work (will reset the writer if so)
Returns:
the processor converting the whole lines with convertor and printing the result including unterminated tail (if present) to the given output writer
See Also:
LineConvertor

ansiStripping

@NonNull
public static InputProcessor ansiStripping(@NonNull
                                                   InputProcessor delegate)
Returns the processor that strips any ANSI escape sequences and passes the result to the delegate.

Reset and close methods on the returned processor invokes the corresponding actions on delegate.

Returned processor is not thread safe.

Parameters:
delegate - processor that will receive characters without control sequences
Returns:
the processor that strips any ansi escape sequences and passes the result to the delegate

org.netbeans.modules.extexecution/2 1.25.1

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.