Class ExternalJs
java.lang.Object
org.apache.maven.doxia.site.ExternalJs
- All Implemented Interfaces:
Serializable, Cloneable
The configuration of an external JS file to be embedded in the
HTML. Leads to an inclusion via the "script" element.
- Version:
- $Revision$ $Date$
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute.private StringOther attributes to include in the "script" element for this external JS file, in the form of a whitespace separated list of key=value pairs.private StringThe referrerpolicy attribute to use when requesting the external JS file.private StringThe URL to include via "script" element with its "src" attribute in the HTML. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Method clone.booleanMethod equals.Get the integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute.Get other attributes to include in the "script" element for this external JS file, in the form of a whitespace separated list of key=value pairs.Get the referrerpolicy attribute to use when requesting the external JS file.getURL()Get the URL to include via "script" element with its "src" attribute in the HTML.inthashCode()Method hashCode.voidsetIntegrity(String integrity) Set the integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute.voidsetOtherAttributes(String otherAttributes) Set other attributes to include in the "script" element for this external JS file, in the form of a whitespace separated list of key=value pairs.voidsetReferrerpolicy(String referrerpolicy) Set the referrerpolicy attribute to use when requesting the external JS file.voidSet the URL to include via "script" element with its "src" attribute in the HTML.toString()Method toString.
-
Field Details
-
URL
The URL to include via "script" element with its "src" attribute in the HTML. -
integrity
The integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute. Its semantics are described in https://www.w3.org/TR/sri-2/ and its usage is strongly recommended. Some example tools for calculating the value are outlined in https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Subresource_Integrity#tools_for_generating_sri_hashes. -
referrerpolicy
The referrerpolicy attribute to use when requesting the external JS file. Its semantics are described in https://www.w3.org/TR/referrer-policy/ and setting it to "no-referrer" prevents sharing unnecessary information with 3rd parties. -
otherAttributes
Other attributes to include in the "script" element for this external JS file, in the form of a whitespace separated list of key=value pairs. The keys and values will be included as-is in the generated "script" element, without any validation.
-
-
Constructor Details
-
ExternalJs
public ExternalJs()
-
-
Method Details
-
clone
-
equals
-
getIntegrity
Get the integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute. Its semantics are described in https://www.w3.org/TR/sri-2/ and its usage is strongly recommended. Some example tools for calculating the value are outlined in https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Subresource_Integrity#tools_for_generating_sri_hashes.- Returns:
- String
-
getOtherAttributes
Get other attributes to include in the "script" element for this external JS file, in the form of a whitespace separated list of key=value pairs. The keys and values will be included as-is in the generated "script" element, without any validation.- Returns:
- String
-
getReferrerpolicy
Get the referrerpolicy attribute to use when requesting the external JS file. Its semantics are described in https://www.w3.org/TR/referrer-policy/ and setting it to "no-referrer" prevents sharing unnecessary information with 3rd parties.- Returns:
- String
-
getURL
Get the URL to include via "script" element with its "src" attribute in the HTML.- Returns:
- String
-
hashCode
-
setIntegrity
Set the integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute. Its semantics are described in https://www.w3.org/TR/sri-2/ and its usage is strongly recommended. Some example tools for calculating the value are outlined in https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Subresource_Integrity#tools_for_generating_sri_hashes.- Parameters:
integrity- a integrity object.
-
setOtherAttributes
Set other attributes to include in the "script" element for this external JS file, in the form of a whitespace separated list of key=value pairs. The keys and values will be included as-is in the generated "script" element, without any validation.- Parameters:
otherAttributes- a otherAttributes object.
-
setReferrerpolicy
Set the referrerpolicy attribute to use when requesting the external JS file. Its semantics are described in https://www.w3.org/TR/referrer-policy/ and setting it to "no-referrer" prevents sharing unnecessary information with 3rd parties.- Parameters:
referrerpolicy- a referrerpolicy object.
-
setURL
Set the URL to include via "script" element with its "src" attribute in the HTML.- Parameters:
URL- a URL object.
-
toString
-
asScriptTag
- Returns:
- the "script" element to include in the HTML for this external JS file.
-