Package org.apache.maven.doxia.site
Class ExternalJs
- java.lang.Object
-
- org.apache.maven.doxia.site.ExternalJs
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class ExternalJs extends java.lang.Object implements java.io.Serializable, java.lang.CloneableThe 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExternalJs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringasScriptTag()ExternalJsclone()Method clone.booleanequals(java.lang.Object other)Method equals.java.lang.StringgetIntegrity()Get the integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute.java.lang.StringgetOtherAttributes()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.java.lang.StringgetReferrerpolicy()Get the referrerpolicy attribute to use when requesting the external JS file.java.lang.StringgetURL()Get the URL to include via "script" element with its "src" attribute in the HTML.inthashCode()Method hashCode.voidsetIntegrity(java.lang.String integrity)Set the integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute.voidsetOtherAttributes(java.lang.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(java.lang.String referrerpolicy)Set the referrerpolicy attribute to use when requesting the external JS file.voidsetURL(java.lang.String URL)Set the URL to include via "script" element with its "src" attribute in the HTML.java.lang.StringtoString()Method toString.
-
-
-
Method Detail
-
clone
public ExternalJs clone()
Method clone.- Overrides:
clonein classjava.lang.Object- Returns:
- ExternalJs
-
equals
public boolean equals(java.lang.Object other)
Method equals.- Overrides:
equalsin classjava.lang.Object- Parameters:
other- a other object.- Returns:
- boolean
-
getIntegrity
public java.lang.String 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
public java.lang.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
public java.lang.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
public java.lang.String getURL()
Get the URL to include via "script" element with its "src" attribute in the HTML.- Returns:
- String
-
hashCode
public int hashCode()
Method hashCode.- Overrides:
hashCodein classjava.lang.Object- Returns:
- int
-
setIntegrity
public void setIntegrity(java.lang.String integrity)
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
public void setOtherAttributes(java.lang.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. The keys and values will be included as-is in the generated "script" element, without any validation.- Parameters:
otherAttributes- a otherAttributes object.
-
setReferrerpolicy
public void setReferrerpolicy(java.lang.String referrerpolicy)
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
public void setURL(java.lang.String URL)
Set the URL to include via "script" element with its "src" attribute in the HTML.- Parameters:
URL- a URL object.
-
toString
public java.lang.String toString()
Method toString.- Overrides:
toStringin classjava.lang.Object- Returns:
- String
-
asScriptTag
public java.lang.String asScriptTag()
- Returns:
- the "script" element to include in the HTML for this external JS file.
-
-