Class JavaScriptValidator

All Implemented Interfaces:
ValidMediaFilter, ValidMediaInput, ValidMediaOutput, NoClose, Closeable, Flushable, Appendable, AutoCloseable

@ThreadSafe public final class JavaScriptValidator extends MediaValidator
Currently performs no validation of the character because JavaScript can use the entire Unicode character set.
Author:
AO Industries, Inc.
  • Method Details

    • getValidMediaInputType

      public MediaType getValidMediaInputType()
      Description copied from interface: ValidMediaInput
      Gets the input type.
    • isValidatingMediaInputType

      public boolean isValidatingMediaInputType(MediaType inputType)
      Description copied from interface: ValidMediaInput
      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 ValidMediaInput.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

      public boolean canSkipValidation(MediaType outputType)
      Description copied from interface: ValidMediaInput
      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 ValidMediaInput.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: