Class JsResourceElement
java.lang.Object
io.github.jeemv.springboot.vuejs.utilities.resources.JsResourceElement
JsResourceElement
This class is part of springBoot-VueJS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds all members name/value of an object to java contents.voidaddVariables(Object[][] keyValues) Adds an array of names,values to the resource.voidaddVariables(String jsonString) Adds names,values of contents to the resource from a json array.Returns the javascript content of the file parsed with the java contents.Adds java content identified by its name.voidsetJsContent(String jsContent)
-
Constructor Details
-
JsResourceElement
public JsResourceElement() -
JsResourceElement
-
-
Method Details
-
put
Adds java content identified by its name.- Parameters:
name- The name of the java content (use ${name} in the js file to refer to it.value- The java content- Returns:
- the previous value associated with name, or null if there was no mapping for name.
-
addVariables
Adds an array of names,values to the resource.- Parameters:
keyValues- Sample new Object[][] { {"id",5},{"name","doe"} }
-
addVariables
Adds names,values of contents to the resource from a json array.- Parameters:
jsonString- sample "{'id':5}"- Throws:
IOException
-
addVariables
Adds all members name/value of an object to java contents.- Parameters:
o-- Throws:
IOException
-
parseContent
Returns the javascript content of the file parsed with the java contents.- Returns:
- The javascript parsed with the java contents
-
setJsContent
-