Package org.rexxla.bsf.engines.rexx
Interface RexxRedirectingCommandHandler
- All Superinterfaces:
RexxCommandHandler,RexxHandler
- All Known Implementing Classes:
AbstractRedirectingCommandHandler,JavaDrawingHandler
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final StringVersion string indicating version of this class (majorVersion*100+minorVersion concatenated with a dot and the sorted date of last change. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanDetermines whether output and error are the same target.default booleanisErrorRedirected(Object slot) Determines whether this invocation redirects error.default booleanisInputRedirected(Object slot) Determines whether this invocation redirects input.default booleanisOutputRedirected(Object slot) Determines whether this invocation redirects output.default booleanIndicates that the command handler is redirectable (a new feature in ooRexx 5.0).default booleanisRedirectionRequested(Object slot) Determines whether this invocation employs redirection.default StringReads the next line from input.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.default StringreadInputBuffer(Object slot) Reads all remaining items from input separated by the platform specific line-end character(s).default StringCreate a string rendering of this environment handler with current settings.default voidwriteError(Object slot, byte[] data) Writes all byte[] data as a single line, does not apply a codepage translation.default voidwriteError(Object slot, String line) Writes a single line of String data.default voidwriteErrorBuffer(Object slot, String data) Writes all String data.default voidwriteOutput(Object slot, byte[] data) Writes all byte[] data as a single line, does not apply a codepage translation.default voidwriteOutput(Object slot, String line) Writes a single line of String data.default voidwriteOutputBuffer(Object slot, String data) Writes the supplied string data, ooRexx will split it into individual lines at CR-LF boundaries.Methods inherited from interface org.rexxla.bsf.engines.rexx.RexxCommandHandler
handleCommandMethods inherited from interface org.rexxla.bsf.engines.rexx.RexxHandler
checkCondition, clearCondition, dropContextVariable, getAllContextVariables, getCallerContext, getConditionInfo, getContextVariable, getGlobalEnvironment, getInterpreterVersion, getLanguageLevel, getLocalEnvironment, getNil, haltThread, newArray, newDirectory, newStem, newStringTable, raiseCondition, raiseException, raiseException0, raiseException1, raiseException2, setContextVariable, setContextVariableToNil, setThreadTrace
-
Field Details
-
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:
isRedirectablein interfaceRexxCommandHandler- Returns:
- returns true
-
isRedirectionRequested
Determines whether this invocation employs redirection.- Returns:
trueif redirection is in effect,falseelse
-
isInputRedirected
Determines whether this invocation redirects input.- Returns:
trueif input redirection is in effect,falseelse
-
isOutputRedirected
Determines whether this invocation redirects output.- Returns:
trueif output redirection is in effect,falseelse
-
isErrorRedirected
Determines whether this invocation redirects error.- Returns:
trueif error redirection is in effect,falseelse
-
areOutputAndErrorSameTarget
Determines whether output and error are the same target.- Returns:
trueif output and error are the same target,falseelse
-
readInput
Reads the next line from input.- Returns:
- the line read from input or null if nothing could be read
-
readInputAsByteArray
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
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
Writes a single line of String data.- Parameters:
slot- opaque argument supplied to the handler methods by the Rexx native code interfaceline- the String data to write to output
-
writeOutput
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 interfacedata- the byte array to write to output
-
writeOutputBuffer
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 interfacedata- the String to write to output
-
writeError
Writes a single line of String data.- Parameters:
slot- opaque argument supplied to the handler methods by the Rexx native code interfaceline- the String data to write to error
-
writeError
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 interfacedata- the byte array to write to error
-
writeErrorBuffer
Writes all String data.- Parameters:
slot- opaque argument supplied to the handler methods by the Rexx native code interfacedata- the String to write to error
-
toString
Create a string rendering of this environment handler with current settings.- Specified by:
toStringin interfaceRexxCommandHandler- Parameters:
slot- supply the received slot argumentenvironmentName- supply the environment name this handler handles- Returns:
- the string rendering of this instance
-