Package org.apache.wicket.csp
Enum CSPDirective
- java.lang.Object
-
- java.lang.Enum<CSPDirective>
-
- org.apache.wicket.csp.CSPDirective
-
- All Implemented Interfaces:
Serializable
,Comparable<CSPDirective>
public enum CSPDirective extends Enum<CSPDirective>
An enum holding the possible CSP Directives. Via thecheckValueForDirective(CSPRenderable, List)
-method, new values are verified before being added to the list of values for a directive.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BASE_URI
CHILD_SRC
CONNECT_SRC
DEFAULT_SRC
FONT_SRC
FORM_ACTION
FRAME_ANCESTORS
FRAME_SRC
This directive was deprecated in CSP 2, but no longer in 3.IMG_SRC
MANIFEST_SRC
MEDIA_SRC
OBJECT_SRC
REPORT_URI
SANDBOX
SCRIPT_SRC
STYLE_SRC
WORKER_SRC
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkValueForDirective(CSPRenderable value, List<CSPRenderable> existingDirectiveValues)
Check ifvalue
can be added to the list of other values.static CSPDirective
fromValue(String value)
String
getValue()
static CSPDirective
valueOf(String name)
Returns the enum constant of this type with the specified name.static CSPDirective[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT_SRC
public static final CSPDirective DEFAULT_SRC
-
SCRIPT_SRC
public static final CSPDirective SCRIPT_SRC
-
STYLE_SRC
public static final CSPDirective STYLE_SRC
-
IMG_SRC
public static final CSPDirective IMG_SRC
-
CONNECT_SRC
public static final CSPDirective CONNECT_SRC
-
FONT_SRC
public static final CSPDirective FONT_SRC
-
OBJECT_SRC
public static final CSPDirective OBJECT_SRC
-
MANIFEST_SRC
public static final CSPDirective MANIFEST_SRC
-
MEDIA_SRC
public static final CSPDirective MEDIA_SRC
-
CHILD_SRC
public static final CSPDirective CHILD_SRC
-
WORKER_SRC
public static final CSPDirective WORKER_SRC
-
FRAME_ANCESTORS
public static final CSPDirective FRAME_ANCESTORS
-
BASE_URI
public static final CSPDirective BASE_URI
-
FRAME_SRC
public static final CSPDirective 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
public static final CSPDirective FORM_ACTION
-
SANDBOX
public static final CSPDirective SANDBOX
-
REPORT_URI
public static final CSPDirective REPORT_URI
-
-
Method Detail
-
values
public static CSPDirective[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CSPDirective c : CSPDirective.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CSPDirective valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
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
public static CSPDirective fromValue(String value)
- Returns:
- The CSPDirective constant whose value-parameter equals the input-parameter or
null
if none can be found.
-
-