- All Implemented Interfaces:
Serializable
,Comparable<CSPDirective>
,Constable
An enum holding the possible CSP Directives. Via the
checkValueForDirective(CSPRenderable, List)
-method, new values are verified before being
added to the list of values for a directive.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThis directive was deprecated in CSP 2, but no longer in 3. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkValueForDirective
(CSPRenderable value, List<CSPRenderable> existingDirectiveValues) Check ifvalue
can be added to the list of other values.static CSPDirective
getValue()
static CSPDirective
Returns the enum constant of this class with the specified name.static CSPDirective[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT_SRC
-
SCRIPT_SRC
-
STYLE_SRC
-
IMG_SRC
-
CONNECT_SRC
-
FONT_SRC
-
OBJECT_SRC
-
MANIFEST_SRC
-
MEDIA_SRC
-
CHILD_SRC
-
WORKER_SRC
-
FRAME_ANCESTORS
-
BASE_URI
-
FRAME_SRC
This directive was deprecated in CSP 2, but no longer in 3. Wicket will automatically add aframe-src
directive whenchild-src
is added. -
FORM_ACTION
-
SANDBOX
-
REPORT_URI
-
-
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
-
getValue
-
checkValueForDirective
public void checkValueForDirective(CSPRenderable value, List<CSPRenderable> existingDirectiveValues) Check ifvalue
can be added to the list of other values. By default, it checks for conflicts with wildcards and none and it checks if values are valid uris.- Parameters:
value
- The value to add.existingDirectiveValues
- The other values.- Throws:
IllegalArgumentException
- if the given value is invalid.
-
fromValue
- Returns:
- The CSPDirective constant whose value-parameter equals the input-parameter or
null
if none can be found.
-