Class JsResourceElement

java.lang.Object
io.github.jeemv.springboot.vuejs.utilities.resources.JsResourceElement

public class JsResourceElement extends Object
JsResourceElement This class is part of springBoot-VueJS
  • Constructor Details

    • JsResourceElement

      public JsResourceElement()
    • JsResourceElement

      public JsResourceElement(Map<String,Object> variables)
  • Method Details

    • put

      public Object put(String name, Object value)
      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

      public void addVariables(Object[][] keyValues)
      Adds an array of names,values to the resource.
      Parameters:
      keyValues - Sample new Object[][] { {"id",5},{"name","doe"} }
    • addVariables

      public void addVariables(String jsonString) throws IOException
      Adds names,values of contents to the resource from a json array.
      Parameters:
      jsonString - sample "{'id':5}"
      Throws:
      IOException
    • addVariables

      public void addVariables(Object o) throws IOException
      Adds all members name/value of an object to java contents.
      Parameters:
      o -
      Throws:
      IOException
    • parseContent

      public String parseContent()
      Returns the javascript content of the file parsed with the java contents.
      Returns:
      The javascript parsed with the java contents
    • setJsContent

      public void setJsContent(String jsContent)