Class Scripts

java.lang.Object
org.opengrok.web.Scripts
All Implemented Interfaces:
Iterable<Scripts.Script>

public class Scripts extends Object implements Iterable<Scripts.Script>
A list-like container for JavasScript sources in JSP/HTML pages.
Author:
Krystof Tulinger
  • Field Details

  • Constructor Details

    • Scripts

      public Scripts()
  • Method Details

    • toHtml

      public String toHtml()
      Convert the page scripts into HTML.
      Returns:
      the HTML
    • toString

      public String toString()
      Return the HTML representation of the page scripts.
      Overrides:
      toString in class Object
      Returns:
      the HTML
      See Also:
    • size

      public int size()
      Return the size of the page scripts.
      Returns:
      the size
      See Also:
    • isEmpty

      public boolean isEmpty()
      Check if there is any script for this page.
      Returns:
      true if there is not; false otherwise
      See Also:
    • iterator

      @NotNull public @NotNull Iterator<Scripts.Script> iterator()
      Iterator over the page scripts.
      Specified by:
      iterator in interface Iterable<Scripts.Script>
      Returns:
      the iterator
      See Also:
    • addScript

      public boolean addScript(String contextPath, String scriptName, org.opengrok.web.Scripts.Type type)
      Add a script which is identified by the name.
      Parameters:
      contextPath - given context path for the used URL
      scriptName - name of the script
      type - type of the script to add
      Returns:
      true if script was added; false otherwise
    • addScript

      public void addScript(Scripts.Script script)
      Add a script to the page, taking the script priority into account.
      Parameters:
      script - the script