org.apache.commons.validator.ValidatorAction.readJavascriptFile()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 JavaScript  
字(3.6k)|赞(0)|评价(0)|浏览(157)

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

ValidatorAction.readJavascriptFile介绍

[英]Read a javascript function from a file.
[中]从文件中读取javascript函数。

代码示例

代码示例来源:origin: commons-validator/commons-validator

/**
 * Load the javascript function specified by the given path.  For this
 * implementation, the <code>jsFunction</code> property should contain a
 * fully qualified package and script name, separated by periods, to be
 * loaded from the class loader that created this instance.
 *
 * TODO if the path begins with a '/' the path will be intepreted as
 * absolute, and remain unchanged.  If this fails then it will attempt to
 * treat the path as a file path.  It is assumed the script ends with a
 * '.js'.
 */
protected synchronized void loadJavascriptFunction() {
  if (this.javascriptAlreadyLoaded()) {
    return;
  }
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading function begun");
  }
  if (this.jsFunction == null) {
    this.jsFunction = this.generateJsFunction();
  }
  String javascriptFileName = this.formatJavascriptFileName();
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading js function '" + javascriptFileName + "'");
  }
  this.javascript = this.readJavascriptFile(javascriptFileName);
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading javascript function completed");
  }
}

代码示例来源:origin: de.knightsoft-net/gwt-commons-validator

/**
 * Load the javascript function specified by the given path.  For this
 * implementation, the <code>jsFunction</code> property should contain a
 * fully qualified package and script name, separated by periods, to be
 * loaded from the class loader that created this instance.
 *
 * TODO if the path begins with a '/' the path will be intepreted as
 * absolute, and remain unchanged.  If this fails then it will attempt to
 * treat the path as a file path.  It is assumed the script ends with a
 * '.js'.
 */
protected synchronized void loadJavascriptFunction() {
  if (this.javascriptAlreadyLoaded()) {
    return;
  }
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading function begun");
  }
  if (this.jsFunction == null) {
    this.jsFunction = this.generateJsFunction();
  }
  String javascriptFileName = this.formatJavascriptFileName();
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading js function '" + javascriptFileName + "'");
  }
  this.javascript = this.readJavascriptFile(javascriptFileName);
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading javascript function completed");
  }
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.validator

/**
 * Load the javascript function specified by the given path.  For this
 * implementation, the <code>jsFunction</code> property should contain a 
 * fully qualified package and script name, separated by periods, to be 
 * loaded from the class loader that created this instance.
 *
 * TODO if the path begins with a '/' the path will be intepreted as 
 * absolute, and remain unchanged.  If this fails then it will attempt to 
 * treat the path as a file path.  It is assumed the script ends with a 
 * '.js'.
 */
protected synchronized void loadJavascriptFunction() {
  if (this.javascriptAlreadyLoaded()) {
    return;
  }
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading function begun");
  }
  if (this.jsFunction == null) {
    this.jsFunction = this.generateJsFunction();
  }
  String javascriptFileName = this.formatJavascriptFileName();
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading js function '" + javascriptFileName + "'");
  }
  this.javascript = this.readJavascriptFile(javascriptFileName);
  if (getLog().isTraceEnabled()) {
    getLog().trace("  Loading javascript function completed");
  }
}

相关文章

微信公众号