- All Implemented Interfaces:
Serializable,Comparable<FetchDirectiveKind>,Constable
Enumerates the CSP fetch directive names and provides their fallback chains.
Each constant corresponds to a fetch directive defined in the CSP specification. The fallback list implements the directive fallback list algorithm, determining which directive governs a request when the most specific directive is not present.
For example, the fallback chain for ScriptSrcElem is:
script-src-elem → script-src → default-src.
- Author:
- Salvation Team
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThechild-srcfetch directive.Theconnect-srcfetch directive.Thedefault-srcfetch directive (fallback for all other fetch directives).Thefont-srcfetch directive.Theframe-srcfetch directive.Theimg-srcfetch directive.Themanifest-srcfetch directive.Themedia-srcfetch directive.Theobject-srcfetch directive.The (deprecated)prefetch-srcfetch directive.Thescript-srcfetch directive.Thescript-src-attrfetch directive.Thescript-src-elemfetch directive.Thestyle-srcfetch directive.Thestyle-src-attrfetch directive.Thestyle-src-elemfetch directive.Theworker-srcfetch directive. -
Method Summary
Modifier and TypeMethodDescriptionstatic FetchDirectiveKindfromString(String name) Looks up aFetchDirectiveKindby its lowercase directive name.getRepr()Returns the lowercase directive name as it appears in a serialized CSP (e.g.static FetchDirectiveKindReturns the enum constant of this class with the specified name.static FetchDirectiveKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ChildSrc
Thechild-srcfetch directive. -
ConnectSrc
Theconnect-srcfetch directive. -
DefaultSrc
Thedefault-srcfetch directive (fallback for all other fetch directives). -
FontSrc
Thefont-srcfetch directive. -
FrameSrc
Theframe-srcfetch directive. -
ImgSrc
Theimg-srcfetch directive. -
ManifestSrc
Themanifest-srcfetch directive. -
MediaSrc
Themedia-srcfetch directive. -
ObjectSrc
Theobject-srcfetch directive. -
PrefetchSrc
The (deprecated)prefetch-srcfetch directive. -
ScriptSrcAttr
Thescript-src-attrfetch directive. -
ScriptSrc
Thescript-srcfetch directive. -
ScriptSrcElem
Thescript-src-elemfetch directive. -
StyleSrcAttr
Thestyle-src-attrfetch directive. -
StyleSrc
Thestyle-srcfetch directive. -
StyleSrcElem
Thestyle-src-elemfetch directive. -
WorkerSrc
Theworker-srcfetch directive.
-
-
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
-
getRepr
Returns the lowercase directive name as it appears in a serialized CSP (e.g."script-src-elem","default-src").- Returns:
- the directive name string
-
fromString
Looks up aFetchDirectiveKindby its lowercase directive name.- Parameters:
name- the directive name to look up (e.g."script-src")- Returns:
- the matching
FetchDirectiveKind, ornullif the name does not correspond to a known fetch directive
-