Interface ValidMediaInput

All Known Subinterfaces:
ValidMediaFilter
All Known Implementing Classes:
BufferedEncoder, BufferedValidator, JavaScriptInXhtmlAttributeEncoder, JavaScriptInXhtmlEncoder, JavaScriptValidator, JavaScriptWriter, JsonWriter, LdJsonWriter, MediaEncoder, MediaValidator, MediaWriter, MysqlValidator, MysqlWriter, NoCloseMediaValidator, PsqlValidator, PsqlWriter, ShValidator, ShWriter, StyleInXhtmlAttributeEncoder, StyleInXhtmlEncoder, StyleValidator, StyleWriter, TextInJavaScriptEncoder, TextInMysqlEncoder, TextInPsqlEncoder, TextInShEncoder, TextInStyleEncoder, TextInXhtmlAttributeEncoder, TextInXhtmlEncoder, TextValidator, TextWriter, UrlInJavaScriptEncoder, UrlInStyleEncoder, UrlInXhtmlAttributeEncoder, UrlInXhtmlEncoder, UrlValidator, UrlWriter, ValidateOnlyEncoder, WhitespaceWriter, XhtmlAttributeValidator, XhtmlAttributeWriter, XhtmlValidator, XhtmlWriter

@ThreadSafe public interface ValidMediaInput
Indicates that the object validates its input for the provided type. If invalid characters are received it will throw an appropriate exception. When the input is already being validated against equal or more restrictive filtering, the redundant validation is not performed.
Author:
AO Industries, Inc.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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.
    Gets the input type.
    boolean
    Checks if this is validating the provided type, which allows one validator to be substituted in place of another.
  • Method Details

    • getValidMediaInputType

      MediaType getValidMediaInputType()
      Gets the input type.
    • isValidatingMediaInputType

      boolean isValidatingMediaInputType(MediaType inputType)
      Checks 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 given inputType.

      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 isValidatingMediaInputType(com.aoapps.encoding.MediaType), with the exception of characters only invalid due to nested encodings.

      Returns:
      true when this validator will throw exceptions on all invalid characters from the given inputType
      See Also:
    • canSkipValidation

      boolean canSkipValidation(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. 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 isValidatingMediaInputType(com.aoapps.encoding.MediaType), with the exception of characters only invalid due to nested encodings.

      Returns:
      true when all valid characters of the given outputType are also valid on this validator
      See Also: