Top Fields Constructors Methods
groovy.xml.streamingmarkupsupport

public Class StreamingMarkupWriter

extends Writer
Class Inheritance
Imports
groovy.io.EncodingAwareBufferedWriter, groovy.xml.markupsupport.DoubleQuoteFilter, .SingleQuoteFilter, .StandardXmlAttributeFilter, .StandardXmlFilter, java.io.IOException, .OutputStreamWriter, .Writer, java.nio.charset.Charset, .CharsetEncoder, java.util.Optional, java.util.function.Function

Field Summary

Modifier and TypeField and Description
private final Function<Character, Optional<String>>
protected final CharsetEncoder
protected final String
protected boolean
private final Writer
protected boolean
private final Function<Character, Optional<String>>
private final Function<Character, Optional<String>>
protected StringBuilder
protected final Writer
protected boolean
Inherited from java.io.Writer:
lock

Constructor Summary

AccessConstructor and Description
public
StreamingMarkupWriter(final Writer writer, final String encoding)

public
StreamingMarkupWriter(final Writer writer, final String encoding, boolean useDoubleQuotes)

public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

Closes the stream, flushing it first.
public Writer
public void
flush()

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

Flushes the stream.
public String
public boolean
private static String
public void
setWritingAttribute(final boolean writingAttribute)

public Writer
public void
write(final int
int specifying a character to be written
c
)

Overrides java.io.Writer.write.

Writes a single character.
public void
write(final char[]
Array of characters
cbuf
,
int
Offset from which to start writing characters
off
,
int
Number of characters to write
len
)

Implements abstract java.io.Writer.write.

Writes a portion of an array of characters.
Inherited from java.io.Writer:
appendappendappendnullWriterwritewritewrite

Field Detail

attrFilterback to summary
private final Function<Character, Optional<String>> attrFilter
encoderback to summary
protected final CharsetEncoder encoder
encodingback to summary
protected final String encoding
encodingKnownback to summary
protected boolean encodingKnown
escapedWriterback to summary
private final Writer escapedWriter
haveHighSurrogateback to summary
protected boolean haveHighSurrogate
quoteFilterback to summary
private final Function<Character, Optional<String>> quoteFilter
stdFilterback to summary
private final Function<Character, Optional<String>> stdFilter
surrogatePairback to summary
protected StringBuilder surrogatePair
writerback to summary
protected final Writer writer
writingAttributeback to summary
protected boolean writingAttribute

Constructor Detail

StreamingMarkupWriterback to summary
public StreamingMarkupWriter(final Writer writer, final String encoding)
StreamingMarkupWriterback to summary
public StreamingMarkupWriter(final Writer writer, final String encoding, boolean useDoubleQuotes)
StreamingMarkupWriterback to summary
public StreamingMarkupWriter(final Writer writer)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Writer.close.

Implements java.io.Closeable.close.

Doc from java.io.Writer.close.

Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.

Exceptions
IOException:
If an I/O error occurs
escapedback to summary
public Writer escaped()
flushback to summary
public void flush() throws IOException

Implements abstract java.io.Writer.flush.

Implements java.io.Flushable.flush.

Doc from java.io.Writer.flush.

Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.

Exceptions
IOException:
If an I/O error occurs
getEncodingback to summary
public String getEncoding()
getEncodingKnownback to summary
public boolean getEncodingKnown()
getNormalizedEncodingback to summary
private static String getNormalizedEncoding(String unnormalized)
setWritingAttributeback to summary
public void setWritingAttribute(final boolean writingAttribute)
unescapedback to summary
public Writer unescaped()
writeback to summary
public void write(final int c) throws IOException

Overrides java.io.Writer.write.

Doc from java.io.Writer.write.

Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.

Subclasses that intend to support efficient single-character output should override this method.

Parameters
c:int

int specifying a character to be written

Exceptions
IOException:
If an I/O error occurs
writeback to summary
public void write(final char[] cbuf, int off, int len) throws IOException

Implements abstract java.io.Writer.write.

Doc from java.io.Writer.write.

Writes a portion of an array of characters.

Parameters
cbuf:char[]

Array of characters

off:int

Offset from which to start writing characters

len:int

Number of characters to write

Exceptions
IOException:
If an I/O error occurs