jetbrains.buildServer.web.functions
Class UtilFunctions

java.lang.Object
  extended by jetbrains.buildServer.web.functions.UtilFunctions

public class UtilFunctions
extends java.lang.Object

TeamCity utility functions

Since:
6.0

Constructor Summary
UtilFunctions()
           
 
Method Summary
static void add(java.util.List list, java.lang.Object item)
          Adds the specified item to the list.
static java.lang.String escapeJavaScript(java.lang.String text, boolean removeLineFeeds, boolean forHTMLAttribute)
          escape given text to be used in javascript
static java.lang.String escapeJavaScriptIdentifier(java.lang.String text)
          escape given text to make it an javascript identifier
static java.lang.String escapeUrlForQuotes(java.lang.String url)
          Escapes url to be used inside quotes
static java.lang.String uniqueId()
          Generate unique id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UtilFunctions

public UtilFunctions()
Method Detail

escapeJavaScriptIdentifier

public static java.lang.String escapeJavaScriptIdentifier(@Nullable
                                                          java.lang.String text)
escape given text to make it an javascript identifier

Parameters:
text - text to escape
Returns:
string that could be used as javascript identifier
Since:
6.0

escapeJavaScript

public static java.lang.String escapeJavaScript(@Nullable
                                                java.lang.String text,
                                                boolean removeLineFeeds,
                                                boolean forHTMLAttribute)
escape given text to be used in javascript

Parameters:
text - text to escape
removeLineFeeds - true to make it removing new lines
forHTMLAttribute - true if escaped text is used inside HTML element's attribute
Returns:
string that could be used as javascript identifier
Since:
6.0

escapeUrlForQuotes

public static java.lang.String escapeUrlForQuotes(@Nullable
                                                  java.lang.String url)
Escapes url to be used inside quotes

Parameters:
url - the url to escape
Returns:
escaped url
Since:
7.0
See Also:
WebUtil.escapeUrlForQuotes()

uniqueId

public static java.lang.String uniqueId()
Generate unique id.

Returns:
unique id withing the bounds of the server

add

public static void add(@NotNull
                       java.util.List list,
                       @NotNull
                       java.lang.Object item)
Adds the specified item to the list.

Parameters:
list - the list
item - the item to add