public class ModelWriter extends Writer
An extension of the Writer class that is used with the ExtensibilityModel. Rather than writing directly to
an output stream this writes to ExtensibilityContent instances in the ExtensibilityModel. This allows rendered
content to be removed, replaced or added to as extensions to the model are processed.
| Constructor and Description |
|---|
ModelWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the current
ExtensibilityContent instance. |
void |
flush()
Flushes the current
ExtensibilityContent instance. |
ExtensibilityContent |
getCurrentBufferElement()
Returns the current
ExtensibilityContent being written to. |
void |
setCurrentBufferElement(ExtensibilityContent bufferElement)
Sets the current
ExtensibilityContent to be written to. |
void |
write(char[] cbuf,
int off,
int len)
Writes to the current
ExtensibilityContent instance. |
void |
write(int c)
Writes to the current
ExtensibilityContent instance. |
void |
write(String str,
int off,
int len)
Writes to the current
ExtensibilityContent instance. |
public void setCurrentBufferElement(ExtensibilityContent bufferElement)
Sets the current ExtensibilityContent to be written to. This typically occurs when the processing of
a new ExtensibilityDirective begins.
bufferElement - The element to start writing to.public ExtensibilityContent getCurrentBufferElement()
Returns the current ExtensibilityContent being written to.
public void write(char[] cbuf,
int off,
int len)
throws IOException
Writes to the current ExtensibilityContent instance.
write in class WriterIOExceptionpublic void flush()
throws IOException
Flushes the current ExtensibilityContent instance.
flush in interface Flushableflush in class WriterIOExceptionpublic void close()
throws IOException
Closes the current ExtensibilityContent instance.
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic void write(int c)
throws IOException
Writes to the current ExtensibilityContent instance.
write in class WriterIOExceptionpublic void write(String str, int off, int len) throws IOException
Writes to the current ExtensibilityContent instance.
write in class WriterIOExceptionCopyright © 2005–2021 Alfresco Software. All rights reserved.