Class ModelWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
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.
- Author:
- David Draper
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the currentExtensibilityContentinstance.voidflush()Flushes the currentExtensibilityContentinstance.Returns the currentExtensibilityContentbeing written to.voidsetCurrentBufferElement(ExtensibilityContent bufferElement) Sets the currentExtensibilityContentto be written to.voidwrite(char[] cbuf, int off, int len) Writes to the currentExtensibilityContentinstance.voidwrite(int c) Writes to the currentExtensibilityContentinstance.voidWrites to the currentExtensibilityContentinstance.
-
Constructor Details
-
ModelWriter
public ModelWriter()
-
-
Method Details
-
setCurrentBufferElement
Sets the current
ExtensibilityContentto be written to. This typically occurs when the processing of a newExtensibilityDirectivebegins.- Parameters:
bufferElement- The element to start writing to.
-
getCurrentBufferElement
Returns the current
ExtensibilityContentbeing written to.- Returns:
- ExtensibilityContent
-
write
Writes to the current
ExtensibilityContentinstance.- Specified by:
writein classWriter- Throws:
IOException
-
flush
Flushes the current
ExtensibilityContentinstance.- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
Closes the current
ExtensibilityContentinstance.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
write
Writes to the current
ExtensibilityContentinstance.- Overrides:
writein classWriter- Throws:
IOException
-
write
Writes to the current
ExtensibilityContentinstance.- Overrides:
writein classWriter- Throws:
IOException
-