- All Implemented Interfaces:
ValidMediaFilter,ValidMediaInput,ValidMediaOutput,Encoder
- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Author:
- AO Industries, Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TextInStyleEncoderSingleton instance intended for static import. -
Method Summary
Modifier and TypeMethodDescriptionappend(char c, Appendable out) append(CharSequence csq, int start, int end, Appendable out) append(CharSequence csq, Appendable out) 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 voidencodeTextInStyle(char[] cbuf, int off, int len, Writer out) See 4.1.3 Characters and case. See 4.3.7 Strings.static voidencodeTextInStyle(char[] cbuf, Writer out) See 4.1.3 Characters and case. See 4.3.7 Strings.static voidencodeTextInStyle(char ch, Appendable out) See 4.1.3 Characters and case. See 4.3.7 Strings.static voidencodeTextInStyle(CharSequence cs, int start, int end, Appendable out) See 4.1.3 Characters and case. See 4.3.7 Strings.static voidencodeTextInStyle(CharSequence cs, Appendable out) See 4.1.3 Characters and case. See 4.3.7 Strings.static voidencodeTextInStyle(Object value, Appendable out) See 4.1.3 Characters and case. See 4.3.7 Strings.Gets the input type.Gets the output type.booleanisValidatingMediaInputType(MediaType inputType) Checks if this is validating the provided type, which allows one validator to be substituted in place of another.voidvoidvoidvoidvoidvoidwritePrefixTo(Appendable out) voidwriteSuffixTo(Appendable out, boolean trim) Methods inherited from class com.aoapps.encoding.MediaEncoder
getInstance, writeSuffixToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.aoapps.lang.io.Encoder
isBuffered
-
Field Details
-
textInStyleEncoder
Singleton instance intended for static import.
-
-
Method Details
-
encodeTextInStyle
- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
IOException
-
encodeTextInStyle
- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
IOException
-
encodeTextInStyle
- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
IOException
-
encodeTextInStyle
- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
IOException
-
encodeTextInStyle
public static void encodeTextInStyle(CharSequence cs, int start, int end, Appendable out) throws IOException - See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
IOException
-
encodeTextInStyle
- See 4.1.3 Characters and case.
- See 4.3.7 Strings.
- Throws:
IOException
-
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:
-
getValidMediaOutputType
Description copied from interface:ValidMediaOutputGets the output type. -
writePrefixTo
Description copied from class:MediaEncoderThis default implementation validates media types in assertion but writes nothing.
- Specified by:
writePrefixToin interfaceEncoder- Overrides:
writePrefixToin classMediaEncoder- Throws:
IOException
-
write
- Specified by:
writein interfaceEncoder- Specified by:
writein classMediaEncoder- Throws:
IOException
-
write
- Specified by:
writein interfaceEncoder- Specified by:
writein classMediaEncoder- Throws:
IOException
-
write
- Specified by:
writein interfaceEncoder- Specified by:
writein classMediaEncoder- Throws:
IOException
-
write
- Specified by:
writein interfaceEncoder- Specified by:
writein classMediaEncoder- Throws:
IOException
-
write
- Specified by:
writein interfaceEncoder- Specified by:
writein classMediaEncoder- Throws:
IOException
-
append
- Specified by:
appendin interfaceEncoder- Specified by:
appendin classMediaEncoder- Throws:
IOException
-
append
- Specified by:
appendin interfaceEncoder- Specified by:
appendin classMediaEncoder- Throws:
IOException
-
append
public TextInStyleEncoder append(CharSequence csq, int start, int end, Appendable out) throws IOException - Specified by:
appendin interfaceEncoder- Specified by:
appendin classMediaEncoder- Throws:
IOException
-
writeSuffixTo
Description copied from class:MediaEncoderThis default implementation validates media types in assertion but writes nothing.
- Specified by:
writeSuffixToin interfaceEncoder- Overrides:
writeSuffixToin classMediaEncoder- Throws:
IOException
-
