Package org.opengrok.web
Class Scripts
java.lang.Object
org.opengrok.web.Scripts
- All Implemented Interfaces:
Iterable<Scripts.Script>
A list-like container for JavasScript sources in JSP/HTML pages.
- Author:
- Krystof Tulinger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Script implementing the toHtml() method as an external script resource.static class
A script wrapper. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a script which is identified by the name.void
addScript
(Scripts.Script script) Add a script to the page, taking the script priority into account.boolean
isEmpty()
Check if there is any script for this page.@NotNull Iterator
<Scripts.Script> iterator()
Iterator over the page scripts.int
size()
Return the size of the page scripts.toHtml()
Convert the page scripts into HTML.toString()
Return the HTML representation of the page scripts.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
SCRIPTS
-
-
Constructor Details
-
Scripts
public Scripts()
-
-
Method Details
-
toHtml
Convert the page scripts into HTML.- Returns:
- the HTML
-
toString
Return the HTML representation of the page scripts. -
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
Iterator over the page scripts.- Specified by:
iterator
in interfaceIterable<Scripts.Script>
- Returns:
- the iterator
- See Also:
-
addScript
Add a script which is identified by the name.- Parameters:
contextPath
- given context path for the used URLscriptName
- name of the scripttype
- type of the script to add- Returns:
- true if script was added; false otherwise
-
addScript
Add a script to the page, taking the script priority into account.- Parameters:
script
- the script
-