jenkins.model.Jenkins.getMarkupFormatter()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(224)

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

Jenkins.getMarkupFormatter介绍

[英]Gets the markup formatter used in the system.
[中]获取系统中使用的标记格式化程序。

代码示例

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

  1. public MarkupFormatter getMarkupFormatter() {
  2. return Jenkins.getInstance().getMarkupFormatter();
  3. }

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

  1. /**
  2. * return parameter description, applying the configured MarkupFormatter for jenkins instance.
  3. * @since 1.521
  4. */
  5. public String getFormattedDescription() {
  6. try {
  7. return Jenkins.getInstance().getMarkupFormatter().translate(description);
  8. } catch (IOException e) {
  9. LOGGER.warning("failed to translate description using configured markup formatter");
  10. return "";
  11. }
  12. }

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

  1. @Restricted(DoNotUse.class) // for value.jelly
  2. public String getFormattedDescription() {
  3. try {
  4. return Jenkins.getInstance().getMarkupFormatter().translate(description);
  5. } catch (IOException e) {
  6. LOGGER.warning("failed to translate description using configured markup formatter");
  7. return "";
  8. }
  9. }

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

  1. @Override
  2. public String getShortDescription() {
  3. if(note != null) {
  4. try {
  5. return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, Jenkins.getInstance().getMarkupFormatter().translate(note));
  6. } catch (IOException x) {
  7. // ignore
  8. }
  9. }
  10. return Messages.Cause_RemoteCause_ShortDescription(addr);
  11. }

代码示例来源:origin: jenkinsci/gitlab-plugin

  1. @Override
  2. String getShortDescription(CauseData data) {
  3. String forkNamespace = StringUtils.equals(data.getSourceNamespace(), data.getTargetBranch()) ? "" : data.getSourceNamespace() + "/";
  4. if (Jenkins.getActiveInstance().getMarkupFormatter() instanceof EscapedMarkupFormatter || data.getTargetProjectUrl() == null) {
  5. return Messages.GitLabWebHookCause_ShortDescription_MergeRequestHook_plain(String.valueOf(data.getMergeRequestIid()),
  6. forkNamespace + data.getSourceBranch(),
  7. data.getTargetBranch());
  8. } else {
  9. return Messages.GitLabWebHookCause_ShortDescription_MergeRequestHook_html(String.valueOf(data.getMergeRequestIid()),
  10. forkNamespace + data.getSourceBranch(),
  11. data.getTargetBranch(),
  12. data.getTargetProjectUrl());
  13. }
  14. }
  15. }, NOTE {

代码示例来源:origin: jenkinsci/gitlab-plugin

  1. @Override
  2. String getShortDescription(CauseData data) {
  3. String triggeredBy = data.getTriggeredByUser();
  4. String forkNamespace = StringUtils.equals(data.getSourceNamespace(), data.getTargetBranch()) ? "" : data.getSourceNamespace() + "/";
  5. if (Jenkins.getActiveInstance().getMarkupFormatter() instanceof EscapedMarkupFormatter || data.getTargetProjectUrl() == null) {
  6. return Messages.GitLabWebHookCause_ShortDescription_NoteHook_plain(triggeredBy,
  7. String.valueOf(data.getMergeRequestIid()),
  8. forkNamespace + data.getSourceBranch(),
  9. data.getTargetBranch());
  10. } else {
  11. return Messages.GitLabWebHookCause_ShortDescription_NoteHook_html(triggeredBy,
  12. String.valueOf(data.getMergeRequestIid()),
  13. forkNamespace + data.getSourceBranch(),
  14. data.getTargetBranch(),
  15. data.getTargetProjectUrl());
  16. }
  17. }
  18. }, PIPELINE {

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

  1. public MarkupFormatter getMarkupFormatter() {
  2. return Jenkins.getInstance().getMarkupFormatter();
  3. }

代码示例来源:origin: org.jenkins-ci.plugins.workflow/workflow-cps-global-lib

  1. /**
  2. * Loads help from user-defined file, if available.
  3. */
  4. public @CheckForNull String getHelpHtml() throws IOException {
  5. if (!help.exists()) return null;
  6. return Jenkins.getActiveInstance().getMarkupFormatter().translate(
  7. FileUtils.readFileToString(help, Charsets.UTF_8).
  8. // Util.escape translates \n but not \r, and we do not know what platform the library will be checked out on:
  9. replace("\r\n", "\n"));
  10. }

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

  1. /**
  2. * return parameter description, applying the configured MarkupFormatter for jenkins instance.
  3. * @since 1.521
  4. */
  5. public String getFormattedDescription() {
  6. try {
  7. return Jenkins.getInstance().getMarkupFormatter().translate(description);
  8. } catch (IOException e) {
  9. LOGGER.warning("failed to translate description using configured markup formatter");
  10. return "";
  11. }
  12. }

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

  1. @Restricted(DoNotUse.class) // for value.jelly
  2. public String getFormattedDescription() {
  3. try {
  4. return Jenkins.getInstance().getMarkupFormatter().translate(description);
  5. } catch (IOException e) {
  6. LOGGER.warning("failed to translate description using configured markup formatter");
  7. return "";
  8. }
  9. }

代码示例来源:origin: org.jenkins-ci.plugins/credentials

  1. /**
  2. * Returns the {@link StandardCredentials#getDescription()} of the {@link #credentials}.
  3. *
  4. * @return the {@link StandardCredentials#getDescription()} of the {@link #credentials}.
  5. * @throws IOException if there was an issue with formatting this using the markup formatter.
  6. */
  7. public String getDescription() throws IOException {
  8. return credentials instanceof StandardCredentials ? Jenkins.getActiveInstance().getMarkupFormatter()
  9. .translate(((StandardCredentials) credentials).getDescription()) : null;
  10. }

代码示例来源:origin: jenkinsci/credentials-plugin

  1. /**
  2. * Returns the {@link StandardCredentials#getDescription()} of the {@link #credentials}.
  3. *
  4. * @return the {@link StandardCredentials#getDescription()} of the {@link #credentials}.
  5. * @throws IOException if there was an issue with formatting this using the markup formatter.
  6. */
  7. public String getDescription() throws IOException {
  8. return credentials instanceof StandardCredentials ? Jenkins.getActiveInstance().getMarkupFormatter()
  9. .translate(((StandardCredentials) credentials).getDescription()) : null;
  10. }

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

  1. @Override
  2. public String getShortDescription() {
  3. if(note != null) {
  4. try {
  5. return Messages.Cause_RemoteCause_ShortDescriptionWithNote(addr, Jenkins.getInstance().getMarkupFormatter().translate(note));
  6. } catch (IOException x) {
  7. // ignore
  8. }
  9. }
  10. return Messages.Cause_RemoteCause_ShortDescription(addr);
  11. }

代码示例来源:origin: jenkinsci/build-failure-analyzer-plugin

  1. /**
  2. * @param stringBuilder the string builder to which to add the matrix run representation
  3. * @param matrixRun the matrix run
  4. * @param indentLevel the indent level
  5. */
  6. private void addMatrixRunRepresentation(final StringBuilder stringBuilder, final MatrixRun matrixRun,
  7. final int indentLevel) {
  8. final FailureCauseDisplayData data = FailureCauseMatrixBuildAction.getFailureCauseDisplayData(matrixRun);
  9. if (data.getFoundFailureCauses().isEmpty() && data.getDownstreamFailureCauses().isEmpty()) {
  10. return;
  11. }
  12. final int nextIndentLevel = indentLevel + LIST_INCREMENT;
  13. if (useHtmlFormat) {
  14. stringBuilder.append("<li>");
  15. try {
  16. stringBuilder.append(Jenkins.getInstance().getMarkupFormatter().translate(
  17. matrixRun.getFullDisplayName()));
  18. } catch (final IOException exception) {
  19. stringBuilder.append("matrix-full-display-name");
  20. }
  21. addFailureCauseDisplayDataRepresentation(stringBuilder, data, nextIndentLevel);
  22. stringBuilder.append("</li>");
  23. } else {
  24. stringBuilder.append(indentForDepth(indentLevel));
  25. stringBuilder.append(LIST_BULLET);
  26. stringBuilder.append(matrixRun.getFullDisplayName());
  27. stringBuilder.append("\n");
  28. addFailureCauseDisplayDataRepresentation(stringBuilder, data, nextIndentLevel);
  29. }
  30. }

代码示例来源:origin: jenkinsci/build-failure-analyzer-plugin

  1. stringBuilder.append("<li>");
  2. try {
  3. stringBuilder.append(Jenkins.getInstance().getMarkupFormatter().translate(cause.getName()));
  4. } catch (final IOException exception) {
  5. stringBuilder.append("cause-name");
  6. stringBuilder.append(Jenkins.getInstance().getMarkupFormatter().translate(cause.getDescription()));
  7. } catch (final IOException exception) {
  8. stringBuilder.append("cause-description");

相关文章

Jenkins类方法