java.lang.Object
java.io.Writer
java.io.FilterWriter
com.aoapps.encoding.MediaValidator
com.aoapps.encoding.BufferedValidator
- All Implemented Interfaces:
ValidMediaFilter
,ValidMediaInput
,ValidMediaOutput
,NoClose
,Closeable
,Flushable
,Appendable
,AutoCloseable
- Direct Known Subclasses:
UrlValidator
Buffers the content to perform final validation.
- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class java.io.FilterWriter
out
-
Method Summary
Modifier and TypeMethodDescriptionfinal BufferedValidator
append
(char c) The default implementation of this append method in Writer calls the write(int) method for backward-compatibility.final BufferedValidator
append
(CharSequence csq) The default implementation of this append method in Writer converts to a String for backward-compatibility.final BufferedValidator
append
(CharSequence csq, int start, int end) The default implementation of this append method in Writer converts to a String for backward-compatibility.final boolean
Is this validator buffered?final void
validate
(boolean trim) Performs final validation and clears the buffer for reuse.final void
write
(char[] cbuf) final void
write
(char[] cbuf, int off, int len) final void
write
(int c) final void
final void
Methods inherited from class com.aoapps.encoding.MediaValidator
getMediaValidator, getOut, getValidMediaOutputType, isNoClose
Methods inherited from class java.io.FilterWriter
close, flush
Methods inherited from class java.io.Writer
nullWriter
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aoapps.encoding.ValidMediaInput
canSkipValidation, getValidMediaInputType, isValidatingMediaInputType
-
Method Details
-
isBuffered
public final boolean isBuffered()Is this validator buffered? A buffered validator may delay validation untilMediaValidator.validate(boolean)
. Furthermore, a buffered validator should not be bypassed before any buffered data has been written viaMediaValidator.validate(boolean)
. An example of encoder bypassing is performing direct output on the writer fromEncoderWriter.getOut()
.- Overrides:
isBuffered
in classMediaValidator
- Returns:
true
since buffered- See Also:
-
write
public final void write(int c) - Overrides:
write
in classFilterWriter
-
write
public final void write(char[] cbuf) -
write
public final void write(char[] cbuf, int off, int len) - Overrides:
write
in classFilterWriter
-
write
-
write
- Overrides:
write
in classFilterWriter
-
append
Description copied from class:MediaValidator
The default implementation of this append method in Writer calls the write(int) method for backward-compatibility. This passes the append directly to the wrapped Writer.- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classMediaValidator
-
append
Description copied from class:MediaValidator
The default implementation of this append method in Writer converts to a String for backward-compatibility. This passes the append directly to the wrapped Writer.- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classMediaValidator
-
append
Description copied from class:MediaValidator
The default implementation of this append method in Writer converts to a String for backward-compatibility. This passes the append directly to the wrapped Writer.- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classMediaValidator
-
validate
Performs final validation and clears the buffer for reuse.- Overrides:
validate
in classMediaValidator
- Parameters:
trim
- Requests that the buffer be trimmed, if buffered and trim supported.- Throws:
IOException
-