Package org.smooks.io
Class ResourceWriter
- java.lang.Object
-
- java.io.Writer
-
- org.smooks.io.ResourceWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class ResourceWriter extends Writer
-
-
Constructor Summary
Constructors Constructor Description ResourceWriter(ExecutionContext executionContext, String resourceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()WritergetDelegateWriter()protected WritergetOutputWriter(String resourceName, ExecutionContext executionContext)Get aWriterto the namedOutputStreamResource.protected OutputStreamopenOutputStream(AbstractOutputStreamResource resource, ExecutionContext executionContext)voidwrite(char[] cbuf, int off, int len)
-
-
-
Constructor Detail
-
ResourceWriter
public ResourceWriter(ExecutionContext executionContext, String resourceName)
-
-
Method Detail
-
write
public void write(char[] cbuf, int off, int len) throws IOException- Specified by:
writein classWriter- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
getOutputWriter
protected Writer getOutputWriter(String resourceName, ExecutionContext executionContext) throws SmooksException
Get aWriterto the namedOutputStreamResource. Wraps theOutputStreamin aWriter. Uses the "writerEncoding" param to set the encoding on theWriter.- Parameters:
resourceName- The resource name.executionContext- The current ExececutionContext.- Returns:
- A
Writerto the namedOutputStreamResource. - Throws:
SmooksException- Unable to access OutputStream.
-
openOutputStream
protected OutputStream openOutputStream(AbstractOutputStreamResource resource, ExecutionContext executionContext)
-
getDelegateWriter
public Writer getDelegateWriter()
-
-