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

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

本文整理了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

  1. /**
  2. * Obtains the 1.526-compatible single string representation.
  3. *
  4. * This method computes JavaScript expression, which evaluates to the URL that the client should request
  5. * the validation to.
  6. * A modern version depends on {@link #toStemUrl()} and {@link #getDependsOn()}
  7. */
  8. public String toCheckUrl() {
  9. if (names==null) return null;
  10. if (checkUrl==null) {
  11. StringBuilder buf = new StringBuilder(singleQuote(relativePath()));
  12. if (!names.isEmpty()) {
  13. buf.append("+qs(this).addThis()");
  14. for (String name : names) {
  15. buf.append(".nearBy('"+name+"')");
  16. }
  17. buf.append(".toString()");
  18. }
  19. checkUrl = buf.toString();
  20. }
  21. // put this under the right contextual umbrella.
  22. // 'a' in getCurrentDescriptorByNameUrl is always non-null because we already have Hudson as the sentinel
  23. return '\'' + jsStringEscape(Descriptor.getCurrentDescriptorByNameUrl()) + "/'+" + checkUrl;
  24. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. /**
  2. * Obtains the 1.526-compatible single string representation.
  3. *
  4. * This method computes JavaScript expression, which evaluates to the URL that the client should request
  5. * the validation to.
  6. * A modern version depends on {@link #toStemUrl()} and {@link #getDependsOn()}
  7. */
  8. public String toCheckUrl() {
  9. if (names==null) return null;
  10. if (checkUrl==null) {
  11. StringBuilder buf = new StringBuilder(singleQuote(relativePath()));
  12. if (!names.isEmpty()) {
  13. buf.append("+qs(this).addThis()");
  14. for (String name : names) {
  15. buf.append(".nearBy('"+name+"')");
  16. }
  17. buf.append(".toString()");
  18. }
  19. checkUrl = buf.toString();
  20. }
  21. // put this under the right contextual umbrella.
  22. // 'a' in getCurrentDescriptorByNameUrl is always non-null because we already have Hudson as the sentinel
  23. return '\'' + jsStringEscape(Descriptor.getCurrentDescriptorByNameUrl()) + "/'+" + checkUrl;
  24. }

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

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

相关文章