Enum Class CspDirective
- All Implemented Interfaces:
Serializable
,Comparable<CspDirective>
,Constable
Enum for Content Security Policy (CSP) directives.
These directives control various resource types that can be loaded or executed in the context of a web page.
- Since:
- 26.1.1
*********************************
EXPERIMENTAL - Subject to change
********************************
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSpecifies valid sources for AJAX, WebSockets, and EventSource.Defines the default policy for fetching resources such as JavaScript, Images, CSS, Fonts, AJAX requests, Frames, HTML5 Media.Specifies valid sources for fonts loaded using font-face.Specifies valid sources for <iframe> and <frame> elements.Specifies valid sources of images.Specifies valid sources of audio and video.Specifies valid sources for the <object>, <embed>, and <applet> elements.Applies extra restrictions to the content security policy of the page.Specifies valid sources for JavaScript.Specifies valid sources for stylesheets. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Defines the default policy for fetching resources such as JavaScript, Images, CSS, Fonts, AJAX requests, Frames, HTML5 Media. -
SCRIPT_SRC
Specifies valid sources for JavaScript. -
STYLE_SRC
Specifies valid sources for stylesheets. -
IMG_SRC
Specifies valid sources of images. -
CONNECT_SRC
Specifies valid sources for AJAX, WebSockets, and EventSource. -
FONT_SRC
Specifies valid sources for fonts loaded using font-face. -
OBJECT_SRC
Specifies valid sources for the <object>, <embed>, and <applet> elements. -
MEDIA_SRC
Specifies valid sources of audio and video. -
FRAME_SRC
Specifies valid sources for <iframe> and <frame> elements. -
SANDBOX
Applies extra restrictions to the content security policy of the page. Values are boolean flags (e.g., 'allow-forms', 'allow-scripts').
-
-
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
-