java.lang.Object
java.io.Writer
com.aoapps.lang.io.WriterFacade
- All Implemented Interfaces:
NoClose
,Closeable
,Flushable
,Appendable
,AutoCloseable
Wraps a writer while passing-through all methods of the writer class.
This is used to hide the implementation of writer from calling classes.
- Author:
- AO Industries, Inc.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionappend
(char c) append
(CharSequence csq) append
(CharSequence csq, int start, int end) void
close()
Calls to close are ignored whenNoClose.isNoClose()
, otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.void
flush()
static WriterFacade
getInstance
(Writer out) Gets an instance of the WriterFacade that wraps the given Writer.boolean
Determines if calls toNoClose.close()
will be ignored.void
write
(char[] cbuf) void
write
(char[] cbuf, int off, int len) void
write
(int c) void
void
Methods inherited from class java.io.Writer
nullWriter
-
Method Details
-
getInstance
Gets an instance of the WriterFacade that wraps the given Writer. If the provided writer is already a WriterFacade, returns it without additional wrapping. -
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
isNoClose
public boolean isNoClose()Description copied from interface:NoClose
Determines if calls toNoClose.close()
will be ignored. This value must not change over time; it may be queried once, repeatedly, or never. -
close
Description copied from interface:NoClose
Calls to close are ignored whenNoClose.isNoClose()
, otherwise some action might be taken which means close calls to this object may not be skipped or assumed to be ignored.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceNoClose
- Specified by:
close
in classWriter
- Throws:
IOException
-