hudson.Util.singleQuote()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(122)

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

Util.singleQuote介绍

[英]Surrounds by a single-quote.
[中]用一句话来概括。

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Obtains the 1.526-compatible single string representation.
 *
 * This method computes JavaScript expression, which evaluates to the URL that the client should request
 * the validation to.
 * A modern version depends on {@link #toStemUrl()} and {@link #getDependsOn()}
 */
public String toCheckUrl() {
  if (names==null)    return null;
  if (checkUrl==null) {
    StringBuilder buf = new StringBuilder(singleQuote(relativePath()));
    if (!names.isEmpty()) {
      buf.append("+qs(this).addThis()");
      for (String name : names) {
        buf.append(".nearBy('"+name+"')");
      }
      buf.append(".toString()");
    }
    checkUrl = buf.toString();
  }
  // put this under the right contextual umbrella.
  // 'a' in getCurrentDescriptorByNameUrl is always non-null because we already have Hudson as the sentinel
  return '\'' + jsStringEscape(Descriptor.getCurrentDescriptorByNameUrl()) + "/'+" + checkUrl;
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * If the field "xyz" of a {@link Describable} has the corresponding "doCheckXyz" method,
 * return the form-field validation string. Otherwise null.
 * <p>
 * This method is used to hook up the form validation method to the corresponding HTML input element.
 */
public String getCheckUrl(String fieldName) {
  String method = checkMethods.get(fieldName);
  if(method==null) {
    method = calcCheckUrl(fieldName);
    checkMethods.put(fieldName,method);
  }
  if (method.equals(NONE)) // == would do, but it makes IDE flag a warning
    return null;
  // put this under the right contextual umbrella.
  // a is always non-null because we already have Hudson as the sentinel
  return singleQuote(getCurrentDescriptorByNameUrl()+'/')+'+'+method;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * If the field "xyz" of a {@link Describable} has the corresponding "doCheckXyz" method,
 * return the form-field validation string. Otherwise null.
 * <p>
 * This method is used to hook up the form validation method to the corresponding HTML input element.
 */
public String getCheckUrl(String fieldName) {
  String method = checkMethods.get(fieldName);
  if(method==null) {
    method = calcCheckUrl(fieldName);
    checkMethods.put(fieldName,method);
  }
  if (method.equals(NONE)) // == would do, but it makes IDE flag a warning
    return null;
  // put this under the right contextual umbrella.
  // a is always non-null because we already have Hudson as the sentinel
  return singleQuote(getCurrentDescriptorByNameUrl()+'/')+'+'+method;
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * If the field "xyz" of a {@link Describable} has the corresponding "doCheckXyz" method,
 * return the form-field validation string. Otherwise null.
 * <p>
 * This method is used to hook up the form validation method to the corresponding HTML input element.
 */
public String getCheckUrl(String fieldName) {
  String method = checkMethods.get(fieldName);
  if(method==null) {
    method = calcCheckUrl(fieldName);
    checkMethods.put(fieldName,method);
  }
  if (method.equals(NONE)) // == would do, but it makes IDE flag a warning
    return null;
  // put this under the right contextual umbrella.
  // a is always non-null because we already have Hudson as the sentinel
  return singleQuote(getCurrentDescriptorByNameUrl()+'/')+'+'+method;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * If the field "xyz" of a {@link Describable} has the corresponding
 * "doCheckXyz" method, return the form-field validation string. Otherwise
 * null. <p> This method is used to hook up the form validation method to
 * the corresponding HTML input element.
 */
public String getCheckUrl(String fieldName) {
  String method = checkMethods.get(fieldName);
  if (method == null) {
    method = calcCheckUrl(fieldName);
    checkMethods.put(fieldName, method);
  }
  if (method.equals(NONE)) // == would do, but it makes IDE flag a warning
  {
    return null;
  }
  // put this under the right contextual umbrella.
  // a is always non-null because we already have Hudson as the sentinel
  return singleQuote(getCurrentDescriptorByNameUrl() + '/') + '+' + method;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

private String calcCheckUrl(String fieldName) {
  String capitalizedFieldName = StringUtils.capitalize(fieldName);
  Method method = ReflectionUtils.getPublicMethodNamed(getClass(), "doCheck" + capitalizedFieldName);
  if (method == null) {
    return NONE;
  }
  return singleQuote(getDescriptorUrl() + "/check" + capitalizedFieldName) + buildParameterList(method, new StringBuilder()).append(".toString()");
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

private String calcCheckUrl(String fieldName) {
  String capitalizedFieldName = StringUtils.capitalize(fieldName);
  Method method = ReflectionUtils.getPublicMethodNamed(getClass(),"doCheck"+ capitalizedFieldName);
  if(method==null)
    return NONE;
  return singleQuote(getDescriptorUrl() +"/check"+capitalizedFieldName) + buildParameterList(method, new StringBuilder()).append(".toString()");
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

private String calcCheckUrl(String fieldName) {
  String capitalizedFieldName = StringUtils.capitalize(fieldName);
  Method method = ReflectionUtils.getPublicMethodNamed(getClass(),"doCheck"+ capitalizedFieldName);
  if(method==null)
    return NONE;
  return singleQuote(getDescriptorUrl() +"/check"+capitalizedFieldName) + buildParameterList(method, new StringBuilder()).append(".toString()");
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Obtains the 1.526-compatible single string representation.
 *
 * This method computes JavaScript expression, which evaluates to the URL that the client should request
 * the validation to.
 * A modern version depends on {@link #toStemUrl()} and {@link #getDependsOn()}
 */
public String toCheckUrl() {
  if (names==null)    return null;
  if (checkUrl==null) {
    StringBuilder buf = new StringBuilder(singleQuote(relativePath()));
    if (!names.isEmpty()) {
      buf.append("+qs(this).addThis()");
      for (String name : names) {
        buf.append(".nearBy('"+name+"')");
      }
      buf.append(".toString()");
    }
    checkUrl = buf.toString();
  }
  // put this under the right contextual umbrella.
  // 'a' in getCurrentDescriptorByNameUrl is always non-null because we already have Hudson as the sentinel
  return '\'' + jsStringEscape(Descriptor.getCurrentDescriptorByNameUrl()) + "/'+" + checkUrl;
}

代码示例来源:origin: hudson/hudson-2.x

private String calcCheckUrl(String fieldName) {
  String capitalizedFieldName = StringUtils.capitalize(fieldName);
  Method method = ReflectionUtils.getPublicMethodNamed(getClass(),"doCheck"+ capitalizedFieldName);
  if(method==null)
    return NONE;
  return singleQuote(getDescriptorUrl() +"/check"+capitalizedFieldName) + buildParameterList(method, new StringBuilder()).append(".toString()");
}

相关文章

微信公众号

最新文章

更多