Interface RexxRedirectingCommandHandler

All Superinterfaces:
RexxCommandHandler, RexxHandler
All Known Implementing Classes:
AbstractRedirectingCommandHandler, JavaDrawingHandler

public interface RexxRedirectingCommandHandler extends RexxCommandHandler
Interface class for Rexx redirecting command handlers. Cf. ooRexx' rexxapi.pdf documentation. Defines all new redirecting methods as default methods.
------------------------ Apache Version 2.0 license -------------------------
    Copyright (C) 2022 Rony G. Flatscher

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 ----------------------------------------------------------------------------- 
Since:
2022-08-22 (BSF4ooRexx 850, baseline Java=8, ooRexx=5.0)
Version:
850.0
Author:
Rony G. Flatscher
  • Field Details

    • version

      static final String version
      Version string indicating version of this class (majorVersion*100+minorVersion concatenated with a dot and the sorted date of last change.
      See Also:
    • IS_REDIRECTION_REQUESTED

      static final int IS_REDIRECTION_REQUESTED
      See Also:
    • IS_INPUT_REDIRECTED

      static final int IS_INPUT_REDIRECTED
      See Also:
    • IS_OUTPUT_REDIRECTED

      static final int IS_OUTPUT_REDIRECTED
      See Also:
    • IS_ERROR_REDIRECTED

      static final int IS_ERROR_REDIRECTED
      See Also:
    • ARE_OUTPUT_AND_ERROR_SAME_TARGET

      static final int ARE_OUTPUT_AND_ERROR_SAME_TARGET
      See Also:
  • Method Details

    • isRedirectable

      default boolean isRedirectable()
      Indicates that the command handler is redirectable (a new feature in ooRexx 5.0).
      Specified by:
      isRedirectable in interface RexxCommandHandler
      Returns:
      returns true
    • isRedirectionRequested

      default boolean isRedirectionRequested(Object slot)
      Determines whether this invocation employs redirection.
      Returns:
      true if redirection is in effect, false else
    • isInputRedirected

      default boolean isInputRedirected(Object slot)
      Determines whether this invocation redirects input.
      Returns:
      true if input redirection is in effect, false else
    • isOutputRedirected

      default boolean isOutputRedirected(Object slot)
      Determines whether this invocation redirects output.
      Returns:
      true if output redirection is in effect, false else
    • isErrorRedirected

      default boolean isErrorRedirected(Object slot)
      Determines whether this invocation redirects error.
      Returns:
      true if error redirection is in effect, false else
    • areOutputAndErrorSameTarget

      default boolean areOutputAndErrorSameTarget(Object slot)
      Determines whether output and error are the same target.
      Returns:
      true if output and error are the same target, false else
    • readInput

      default String readInput(Object slot)
      Reads the next line from input.
      Returns:
      the line read from input or null if nothing could be read
    • readInputAsByteArray

      default byte[] readInputAsByteArray(Object slot)
      Reads the next line from input, does not apply a codepage translation to Java but returns the data as a byte array. Intended for fetching binary data.
      Returns:
      the line read from input or null if nothing could be read
    • readInputBuffer

      default String readInputBuffer(Object slot)
      Reads all remaining items from input separated by the platform specific line-end character(s).
      Returns:
      all remaining items from input separated by the platform specific line-end character(s) or null if nothing could be read
    • writeOutput

      default void writeOutput(Object slot, String line)
      Writes a single line of String data.
      Parameters:
      slot - opaque argument supplied to the handler methods by the Rexx native code interface
      line - the String data to write to output
    • writeOutput

      default void writeOutput(Object slot, byte[] data)
      Writes all byte[] data as a single line, does not apply a codepage translation. Intended for writing binary data.
      Parameters:
      slot - opaque argument supplied to the handler methods by the Rexx native code interface
      data - the byte array to write to output
    • writeOutputBuffer

      default void writeOutputBuffer(Object slot, String data)
      Writes the supplied string data, ooRexx will split it into individual lines at CR-LF boundaries.
      Parameters:
      slot - opaque argument supplied to the handler methods by the Rexx native code interface
      data - the String to write to output
    • writeError

      default void writeError(Object slot, String line)
      Writes a single line of String data.
      Parameters:
      slot - opaque argument supplied to the handler methods by the Rexx native code interface
      line - the String data to write to error
    • writeError

      default void writeError(Object slot, byte[] data)
      Writes all byte[] data as a single line, does not apply a codepage translation. Intended for writing binary data.
      Parameters:
      slot - opaque argument supplied to the handler methods by the Rexx native code interface
      data - the byte array to write to error
    • writeErrorBuffer

      default void writeErrorBuffer(Object slot, String data)
      Writes all String data.
      Parameters:
      slot - opaque argument supplied to the handler methods by the Rexx native code interface
      data - the String to write to error
    • toString

      default String toString(Object slot, String environmentName)
      Create a string rendering of this environment handler with current settings.
      Specified by:
      toString in interface RexxCommandHandler
      Parameters:
      slot - supply the received slot argument
      environmentName - supply the environment name this handler handles
      Returns:
      the string rendering of this instance