|
Ajocado API 1.0.0.Alpha2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.arquillian.ajocado.encapsulated.JavaScript
public class JavaScript
Encapsulates JavaScript definitions.
Able to load JavaScript code from file or from classpath resource.
| Constructor Summary | |
|---|---|
JavaScript(String javaScript)
Instantiates a new java script. |
|
| Method Summary | |
|---|---|
JavaScript |
append(String javaScriptPartToAppend)
Append the JavaScript part to end of the this JavaScript |
static JavaScript |
fromFile(File sourceFile)
Loads the JavaScript from file. |
static JavaScript |
fromResource(String resourceName)
Loads the JavaScript from classpath resource. |
String |
getAsString()
Gets the JavaScript as string |
String |
getIdentification()
Gets a identification for this script based on script's hashcode. |
JavaScript |
join(JavaScript javaScriptToJoin)
Joins this JavaScript object with another JavaScript object to single JavaScript. |
static JavaScript |
js(String javaScript)
The factory method for JavaScript object |
JavaScript |
parametrize(Object... parameters)
Fills the parameters to placeholders in simplified format (look for Simplified format) to this JavaScript code and returns the result. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JavaScript(String javaScript)
javaScript - the java script code| Method Detail |
|---|
public static JavaScript js(String javaScript)
javaScript - code
public String getAsString()
public String toString()
toString in class Objectpublic JavaScript join(JavaScript javaScriptToJoin)
javaScriptToJoin - the JavaScript object we want to join with
public JavaScript append(String javaScriptPartToAppend)
javaScriptPartToAppend - javaScript to append on the end of this JavaScript
public String getIdentification()
Gets a identification for this script based on script's hashcode.
It can be used to uniquely distinguish the script on the page.
public static JavaScript fromFile(File sourceFile)
sourceFile - the source file
RuntimeException - when failed to load a scriptpublic static JavaScript fromResource(String resourceName)
resourceName - the resource name, e.g. "org/jboss/test/..."
RuntimeException - when failed to load a scriptpublic JavaScript parametrize(Object... parameters)
parameters - to parametrize this JavaScript code
|
Ajocado API 1.0.0.Alpha2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||