Package org.apache.wicket.csp
Enum CSPDirectiveSrcValue
- java.lang.Object
-
- java.lang.Enum<CSPDirectiveSrcValue>
-
- org.apache.wicket.csp.CSPDirectiveSrcValue
-
- All Implemented Interfaces:
Serializable
,Comparable<CSPDirectiveSrcValue>
,CSPRenderable
public enum CSPDirectiveSrcValue extends Enum<CSPDirectiveSrcValue> implements CSPRenderable
An enum holding the default values for -src directives including the mandatory single quotes
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NONCE
NONE
SELF
STRICT_DYNAMIC
UNSAFE_EVAL
UNSAFE_INLINE
WILDCARD
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getValue()
String
render(ContentSecurityPolicySettings settings, RequestCycle cycle)
Renders the value that should be put in the CSP header.static CSPDirectiveSrcValue
valueOf(String name)
Returns the enum constant of this type with the specified name.static CSPDirectiveSrcValue[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.apache.wicket.csp.CSPRenderable
checkValidityForSrc
-
-
-
-
Enum Constant Detail
-
NONE
public static final CSPDirectiveSrcValue NONE
-
WILDCARD
public static final CSPDirectiveSrcValue WILDCARD
-
SELF
public static final CSPDirectiveSrcValue SELF
-
UNSAFE_INLINE
public static final CSPDirectiveSrcValue UNSAFE_INLINE
-
UNSAFE_EVAL
public static final CSPDirectiveSrcValue UNSAFE_EVAL
-
STRICT_DYNAMIC
public static final CSPDirectiveSrcValue STRICT_DYNAMIC
-
NONCE
public static final CSPDirectiveSrcValue NONCE
-
-
Method Detail
-
values
public static CSPDirectiveSrcValue[] 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 (CSPDirectiveSrcValue c : CSPDirectiveSrcValue.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CSPDirectiveSrcValue 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
-
render
public String render(ContentSecurityPolicySettings settings, RequestCycle cycle)
Description copied from interface:CSPRenderable
Renders the value that should be put in the CSP header.- Specified by:
render
in interfaceCSPRenderable
- Parameters:
settings
- TheContentSecurityPolicySettings
that renders this value.cycle
- The currentRequestCycle
.- Returns:
- The rendered value.
-
-