com.jwebmp.core.base.html.Body.getVariablesAll()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中com.jwebmp.core.base.html.Body.getVariablesAll()方法的一些代码示例,展示了Body.getVariablesAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.getVariablesAll()方法的具体详情如下:
包路径:com.jwebmp.core.base.html.Body
类名称:Body
方法名:getVariablesAll

Body.getVariablesAll介绍

暂无

代码示例

代码示例来源:origin: com.jwebmp.jre11/jwebmp-core

/**
   * Adds the variables in the application to the collection
   */
  @SuppressWarnings("unchecked")
  private void addVariablesScriptToPage()
  {
    StringBuilder variablesScriptBuilder = new StringBuilder();
    for (Object o : getBody().getVariablesAll())
    {
      String var = (String) o;
      variablesScriptBuilder.append("var ")
                 .append(var)
                 .append(StaticStrings.STRING_SEMICOLON);
    }
    if (variablesScriptBuilder.length() > 0)
    {
      Script variablesScript = new Script();
      variablesScript.setID("variables");
      variablesScript.setNewLineForRawText(true);
      variablesScript.addAttribute(ScriptAttributes.Type, StaticStrings.HTML_HEADER_JAVASCRIPT);
      variablesScript.setText(variablesScriptBuilder.toString());
      if (!getHead().getChildren()
             .contains(variablesScript))
      {
        getHead().add(variablesScript);
      }
    }
  }
}

代码示例来源:origin: com.jwebmp.jre10/jwebmp-core

/**
   * Adds the variables in the application to the collection
   */
  @SuppressWarnings("unchecked")
  private void addVariablesScriptToPage()
  {
    StringBuilder variablesScriptBuilder = new StringBuilder();
    for (Object o : getBody().getVariablesAll())
    {
      String var = (String) o;
      variablesScriptBuilder.append("var ")
                 .append(var)
                 .append(StaticStrings.STRING_SEMICOLON);
    }
    if (variablesScriptBuilder.length() > 0)
    {
      Script variablesScript = new Script();
      variablesScript.setID("variables");
      variablesScript.setNewLineForRawText(true);
      variablesScript.addAttribute(ScriptAttributes.Type, StaticStrings.HTML_HEADER_JAVASCRIPT);
      variablesScript.setText(variablesScriptBuilder.toString());
      if (!getHead().getChildren()
             .contains(variablesScript))
      {
        getHead().add(variablesScript);
      }
    }
  }
}

代码示例来源:origin: com.jwebmp/jwebmp-core

/**
   * Adds the variables in the application to the collection
   */
  @SuppressWarnings("unchecked")
  private void addVariablesScriptToPage()
  {
    StringBuilder variablesScriptBuilder = new StringBuilder();
    for (Object o : getBody().getVariablesAll())
    {
      String var = (String) o;
      variablesScriptBuilder.append("var ")
                 .append(var)
                 .append(StaticStrings.STRING_SEMICOLON);
    }
    if (variablesScriptBuilder.length() > 0)
    {
      Script variablesScript = new Script();
      variablesScript.setID("variables");
      variablesScript.setNewLineForRawText(true);
      variablesScript.addAttribute(ScriptAttributes.Type, StaticStrings.HTML_HEADER_JAVASCRIPT);
      variablesScript.setText(variablesScriptBuilder.toString());
      if (!getHead().getChildren()
             .contains(variablesScript))
      {
        getHead().add(variablesScript);
      }
    }
  }
}

相关文章