- All Implemented Interfaces:
Serializable,Comparable<ValidationType>,Constable
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 ConstantsEnum ConstantDescriptionRequest/response body contentCookie 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 TypeMethodDescriptionbooleanisBody()Determines if this validation type represents HTTP body content.booleanisCookie()Determines if this validation type represents cookie content.booleanisHeader()Determines if this validation type represents HTTP header content.booleanisKey()Determines if this validation type represents a key/name component.booleanDetermines if this validation type represents parameter content.booleanisPath()Determines if this validation type represents a path component.booleanisValue()Determines if this validation type represents a value component.booleanDetermines if this validation type requires URL decoding during processing.static ValidationTypeReturns the enum constant of this class with the specified name.static ValidationType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
URL_PATH
URL path segments (e.g., "/api/users/123") -
PARAMETER_NAME
Query parameter names (e.g., "userId" in "?userId=123") -
PARAMETER_VALUE
Query parameter values (e.g., "123" in "?userId=123") -
HEADER_NAME
HTTP header names (e.g., "Authorization", "Content-Type") -
HEADER_VALUE
HTTP header values (e.g., "Bearer token123", "application/json") -
COOKIE_NAME
Cookie names (e.g., "JSESSIONID", "auth_token") -
COOKIE_VALUE
Cookie values (e.g., session identifiers, authentication tokens) -
BODY
Request/response body content
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
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
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
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
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
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
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
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
Determines if this validation type represents parameter content. Parameter components are commonly targeted in injection attacks.- Returns:
- true if this type represents parameter content
-