| Modifier and Type | Class and Description |
|---|---|
private static class |
UnnamedStreams.ContextContainer
Simple container that stores and returns a context-local instance of
the global work area.
|
private static class |
UnnamedStreams.InputCloser
Finalizable class which will perform a closeIn call only if this class
is in the top of the closerIn stack - this way we make sure there are
not possible two subsequent calls to the closeIn statement.
|
private static class |
UnnamedStreams.OutputCloser
Finalizable class which will perform a closeOut call only if this class
is in the top of the closerOut stack - this way we make sure there are
not possible two subsequent calls to the closeOut statement.
|
private static class |
UnnamedStreams.WorkArea
Stores global data relating to the state of the current context.
|
| Modifier and Type | Field and Description |
|---|---|
private UnnamedStreams.WorkArea |
wa
The state for this instance.
|
private static UnnamedStreams.ContextContainer |
work
Stores context-local state variables.
|
| Modifier | Constructor and Description |
|---|---|
private |
UnnamedStreams()
Private constructor so external code cannot instantiate this class.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
assignBoth(Stream stream)
Assigns the streams representing both the unnamed output stream and the
unnamed input stream.
|
static void |
assignIn(Stream in)
Assigns the stream representing the unnamed input stream.
|
private static void |
assignInWorker(UnnamedStreams.WorkArea wa,
Stream in,
boolean register)
Assigns the stream representing the unnamed input stream.
|
static void |
assignOut(Stream out)
Assigns the stream representing the unnamed output stream.
|
static void |
assignOut(Stream out,
java.lang.String lobDir)
Assigns the stream representing the unnamed output stream.
|
private static void |
assignOutWorker(UnnamedStreams.WorkArea wa,
Stream out,
boolean register)
Assigns the stream representing the unnamed output stream.
|
static void |
closeBoth()
Closes both the unnamed input stream and the unnamed output stream.
|
static void |
closeIn()
Closes the stream representing the unnamed input stream.
|
private static void |
closeInInt(UnnamedStreams.WorkArea wa)
Closes the stream representing the unnamed input stream.
|
static void |
closeOut()
Closes the stream representing the unnamed output stream.
|
private static void |
closeOutInt(UnnamedStreams.WorkArea wa)
Closes the stream representing the unnamed output stream.
|
ScopeId |
getScopeId()
Get the
ScopeId for the instance. |
static Stream |
input()
Gets the stream representing the unnamed input stream.
|
static boolean |
isOut()
State of the output side of the unnamed stream.
|
private static Stream |
makeSafe(Stream safe)
Returns the given stream if it is not
null, otherwise it
returns a safe stream instance that can be used for operations that
should effectively be a NOP. |
static Stream |
output()
Gets the stream representing the unnamed output stream.
|
static Stream |
safeInput()
Gets the stream representing the unnamed input stream or a safe stream
instance that can be used for operations that should effectively be
NOP. |
static Stream |
safeOutput()
Gets the stream representing the unnamed output stream or a safe stream
instance that can be used for operations that should effectively be
NOP. |
void |
scopeDeleted()
Provides notification that the external procedure scope has been deleted.
|
void |
scopeFinished()
Provides a notification that a scope is about to be exited.
|
void |
scopeStart(BlockDefinition block)
Provides a notification that a new scope is about to be entered.
|
private static final UnnamedStreams.ContextContainer work
private final UnnamedStreams.WorkArea wa
private UnnamedStreams()
public static Stream input()
null if the unnamed
input stream has not been explicitly redirected.public static Stream safeInput()
NOP.NullStream instance if the unnamed
input stream has not been explicitly redirected.public static void assignIn(Stream in)
in - The unnamed input stream to set or null if any
current input stream redirection is to be cleared.public static void closeIn()
null (if the current redirection when the scope
opened was null).public static Stream output()
null if the unnamed
output stream has not been explicitly redirected.public static Stream safeOutput()
NOP.NullStream instance if the unnamed
output stream has not been explicitly redirected.public static void assignOut(Stream out, java.lang.String lobDir)
out - The unnamed output stream to set or null if any
current output stream redirection is to be cleared.lobDir - The folder where to write any CLOB or BLOB fields.public static void assignOut(Stream out)
out - The unnamed output stream to set or null if any
current output stream redirection is to be cleared.public static void closeOut()
null (if the current redirection when the scope
opened was null).public static void assignBoth(Stream stream)
stream - The unnamed output stream to set or null if any
current output stream redirection is to be cleared.public static void closeBoth()
public void scopeStart(BlockDefinition block)
scopeStart in interface Scopeableblock - The explicit block definition which required this notification.public void scopeFinished()
scopeFinished in interface Scopeablepublic void scopeDeleted()
This is a no-op for unnamed streams.
scopeDeleted in interface Scopeablepublic ScopeId getScopeId()
ScopeId for the instance.getScopeId in interface ScopeableScopeId.UNNAMED_STREAMS.public static boolean isOut()
true if the output side of the stream is active.private static Stream makeSafe(Stream safe)
null, otherwise it
returns a safe stream instance that can be used for operations that
should effectively be a NOP.safe - The stream to check.NullStream
instance if the given stream is null.private static void assignInWorker(UnnamedStreams.WorkArea wa, Stream in, boolean register)
wa - The context-local state.in - The unnamed input stream to set or null if any
current input stream redirection is to be cleared.register - If true and the stream parameter is non-null,
then a call to registerTopLevelFinalizable will be performed.private static void assignOutWorker(UnnamedStreams.WorkArea wa, Stream out, boolean register)
wa - The context-local state.out - The unnamed output stream to set or null if any
current output stream redirection is to be cleared.register - If true and the stream parameter is non-null,
then a call to registerTopLevelFinalizable will be performed.private static void closeInInt(UnnamedStreams.WorkArea wa)
null (if the current redirection when the scope
opened was null).wa - The context-local state.private static void closeOutInt(UnnamedStreams.WorkArea wa)
null (if the current redirection when the scope
opened was null).wa - The context-local state.