Enum Class ValidationType

java.lang.Object
java.lang.Enum<ValidationType>
de.cuioss.http.security.core.ValidationType
All Implemented Interfaces:
Serializable, Comparable<ValidationType>, Constable

public enum ValidationType extends Enum<ValidationType>
Enumeration of different types of HTTP components that require validation. Each validation type may have different security requirements and validation rules.

Design Principles

  • Type Safety - Provides compile-time safety for validation contexts
  • Context Awareness - Different validation rules per component type
  • Performance - Enables optimized validation strategies per type
  • Extensibility - Easy to add new HTTP component types

Usage Example

 // Validate URL path component
 validator.validate("/api/users", ValidationType.URL_PATH);

 // Validate query parameter name
 validator.validate("userId", ValidationType.PARAMETER_NAME);

 // Validate HTTP header value
 validator.validate("Bearer token123", ValidationType.HEADER_VALUE);
 
Supports: Task B2 from HTTP verification specification
Since:
1.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Request/response body content
    Cookie names (e.g., "JSESSIONID", "auth_token")
    Cookie values (e.g., session identifiers, authentication tokens)
    HTTP header names (e.g., "Authorization", "Content-Type")
    HTTP header values (e.g., "Bearer token123", "application/json")
    Query parameter names (e.g., "userId" in "?
    Query parameter values (e.g., "123" in "?
    URL path segments (e.g., "/api/users/123")
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines if this validation type represents HTTP body content.
    boolean
    Determines if this validation type represents cookie content.
    boolean
    Determines if this validation type represents HTTP header content.
    boolean
    Determines if this validation type represents a key/name component.
    boolean
    Determines if this validation type represents parameter content.
    boolean
    Determines if this validation type represents a path component.
    boolean
    Determines if this validation type represents a value component.
    boolean
    Determines if this validation type requires URL decoding during processing.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

  • Method Details

    • values

      public static ValidationType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ValidationType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • requiresDecoding

      public boolean requiresDecoding()
      Determines if this validation type requires URL decoding during processing. URL decoding is typically needed for components that may contain percent-encoded sequences.
      Returns:
      true if URL decoding should be applied before validation
    • isKey

      public boolean isKey()
      Determines if this validation type represents a key/name component. Key components typically have more restrictive character sets and length limits.
      Returns:
      true if this type represents a key/name component
    • isValue

      public boolean isValue()
      Determines if this validation type represents a value component. Value components may allow a broader range of characters and content.
      Returns:
      true if this type represents a value component
    • isBody

      public boolean isBody()
      Determines if this validation type represents HTTP body content. Body content has special handling for different content types and encodings.
      Returns:
      true if this type represents body content
    • isPath

      public boolean isPath()
      Determines if this validation type represents a path component. Path components have specific rules for traversal detection and normalization.
      Returns:
      true if this type represents a path component
    • isHeader

      public boolean isHeader()
      Determines if this validation type represents HTTP header content. Header components (names and values) have RFC-specific formatting rules.
      Returns:
      true if this type represents header content
    • isCookie

      public boolean isCookie()
      Determines if this validation type represents cookie content. Cookie components have specific encoding and security requirements.
      Returns:
      true if this type represents cookie content
    • isParameter

      public boolean isParameter()
      Determines if this validation type represents parameter content. Parameter components are commonly targeted in injection attacks.
      Returns:
      true if this type represents parameter content