Class ExternalJs

java.lang.Object
org.apache.maven.doxia.site.ExternalJs
All Implemented Interfaces:
Serializable, Cloneable

public class ExternalJs extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    private String
    The integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute.
    private String
    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.
    private String
    The referrerpolicy attribute to use when requesting the external JS file.
    private String
    The URL to include via "script" element with its "src" attribute in the HTML.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Method clone.
    boolean
    equals(Object other)
    Method 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.
    Get the URL to include via "script" element with its "src" attribute in the HTML.
    int
    Method hashCode.
    void
    setIntegrity(String integrity)
    Set the integrity hash to use for the external JS file emitted in the "script" element's "integrity" attribute.
    void
    setOtherAttributes(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.
    void
    setReferrerpolicy(String referrerpolicy)
    Set the referrerpolicy attribute to use when requesting the external JS file.
    void
    Set the URL to include via "script" element with its "src" attribute in the HTML.
    Method toString.

    Methods inherited from class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • URL

      private String URL
      The URL to include via "script" element with its "src" attribute in the HTML.
    • integrity

      private String 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

      private String 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

      private String 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

      public ExternalJs clone()
      Method clone.
      Overrides:
      clone in class Object
      Returns:
      ExternalJs
    • equals

      public boolean equals(Object other)
      Method equals.
      Overrides:
      equals in class Object
      Parameters:
      other - a other object.
      Returns:
      boolean
    • getIntegrity

      public 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 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 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 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:
      hashCode in class Object
      Returns:
      int
    • setIntegrity

      public void setIntegrity(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(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(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(String URL)
      Set the URL to include via "script" element with its "src" attribute in the HTML.
      Parameters:
      URL - a URL object.
    • toString

      public String toString()
      Method toString.
      Overrides:
      toString in class Object
      Returns:
      String
    • asScriptTag

      public String asScriptTag()
      Returns:
      the "script" element to include in the HTML for this external JS file.