- All Implemented Interfaces:
ValidMediaFilter,ValidMediaInput,ValidMediaOutput,NoClose,Closeable,Flushable,Appendable,AutoCloseable
- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class java.io.FilterWriter
out -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) The default implementation of this append method in Writer calls the write(int) method for backward-compatibility.append(CharSequence csq) The default implementation of this append method in Writer converts to a String for backward-compatibility.append(CharSequence csq, int start, int end) The default implementation of this append method in Writer converts to a String for backward-compatibility.booleancanSkipValidation(MediaType outputType) Checks if validation may be skipped when the characters being written to this validator is already known to be valid with the given media type.static voidcheckCharacter(char c) Checks one character, throwsInvalidCharacterExceptionif invalid.static voidcheckCharacters(char[] cbuf, int off, int len) Checks a set of characters, throwsInvalidCharacterExceptionif invalid.static voidcheckCharacters(CharSequence str, int start, int end) Checks a set of characters, throwsInvalidCharacterExceptionif invalid.Gets the input type.booleanisValidatingMediaInputType(MediaType inputType) Checks if this is validating the provided type, which allows one validator to be substituted in place of another.voidwrite(char[] cbuf, int off, int len) voidwrite(int c) voidMethods inherited from class com.aoapps.encoding.MediaValidator
getMediaValidator, getOut, getValidMediaOutputType, isBuffered, isNoClose, validateMethods inherited from class java.io.FilterWriter
close, flushMethods inherited from class java.io.Writer
nullWriter, write, write
-
Method Details
-
checkCharacter
Checks one character, throwsInvalidCharacterExceptionif invalid.- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
InvalidCharacterException
-
checkCharacters
Checks a set of characters, throwsInvalidCharacterExceptionif invalid.- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
InvalidCharacterException
-
checkCharacters
public static void checkCharacters(CharSequence str, int start, int end) throws InvalidCharacterException Checks a set of characters, throwsInvalidCharacterExceptionif invalid.- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
InvalidCharacterException
-
getValidMediaInputType
Description copied from interface:ValidMediaInputGets the input type. -
isValidatingMediaInputType
Description copied from interface:ValidMediaInputChecks if this is validating the provided type, which allows one validator to be substituted in place of another. This is acceptable when this validator is equal to, or more strict, than the giveninputType.Please note that this validator only needs to block invalid characters for
inputType. This validator does not need to let through all characters, just block the invalid. This is a one-way optimization.This is almost the inverse operation of
ValidMediaInput.isValidatingMediaInputType(com.aoapps.encoding.MediaType), with the exception of characters only invalid due to nested encodings.- Returns:
truewhen this validator will throw exceptions on all invalid characters from the giveninputType- See Also:
-
canSkipValidation
Description copied from interface:ValidMediaInputChecks if validation may be skipped when the characters being written to this validator is already known to be valid with the given media type. This may be done when every valid character for the given media type is also valid within this validator.This is almost the inverse operation of
ValidMediaInput.isValidatingMediaInputType(com.aoapps.encoding.MediaType), with the exception of characters only invalid due to nested encodings.- Returns:
truewhen all valid characters of the givenoutputTypeare also valid on this validator- See Also:
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
write
- Overrides:
writein classFilterWriter- Throws:
IOException
-
append
Description copied from class:MediaValidatorThe 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:
appendin interfaceAppendable- Overrides:
appendin classMediaValidator- Throws:
IOException
-
append
Description copied from class:MediaValidatorThe 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:
appendin interfaceAppendable- Overrides:
appendin classMediaValidator- Throws:
IOException
-
append
Description copied from class:MediaValidatorThe 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:
appendin interfaceAppendable- Overrides:
appendin classMediaValidator- Throws:
IOException
-
