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) voidclose()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.voidflush()static WriterFacadegetInstance(Writer out) Gets an instance of the WriterFacade that wraps the given Writer.booleanDetermines if calls toNoClose.close()will be ignored.voidwrite(char[] cbuf) voidwrite(char[] cbuf, int off, int len) voidwrite(int c) voidvoidMethods 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:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
isNoClose
public boolean isNoClose()Description copied from interface:NoCloseDetermines 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:NoCloseCalls 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceNoClose- Specified by:
closein classWriter- Throws:
IOException
-
