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 void
close()
void
flush()
Writer
getDelegateWriter()
protected Writer
getOutputWriter(String resourceName, ExecutionContext executionContext)
Get aWriter
to the namedOutputStream
Resource.protected OutputStream
openOutputStream(AbstractOutputStreamResource resource, ExecutionContext executionContext)
void
write(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:
write
in classWriter
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
getOutputWriter
protected Writer getOutputWriter(String resourceName, ExecutionContext executionContext) throws SmooksException
Get aWriter
to the namedOutputStream
Resource. Wraps theOutputStream
in aWriter
. Uses the "writerEncoding" param to set the encoding on theWriter
.- Parameters:
resourceName
- The resource name.executionContext
- The current ExececutionContext.- Returns:
- A
Writer
to the namedOutputStream
Resource. - Throws:
SmooksException
- Unable to access OutputStream.
-
openOutputStream
protected OutputStream openOutputStream(AbstractOutputStreamResource resource, ExecutionContext executionContext)
-
getDelegateWriter
public Writer getDelegateWriter()
-
-