org.apache.tools.ant.Project.setDescription()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(89)

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

Project.setDescription介绍

[英]Set the project description.
[中]设置项目描述。

代码示例

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds the text as description to the project.
 *
 * @param buf A character array of the text within the element.
 *            Will not be <code>null</code>.
 * @param start The start element in the array.
 * @param count The number of characters to read from the array.
 */
public void characters(char[] buf, int start, int count) {
  String text = new String(buf, start, count);
  String currentDescription = helperImpl.project.getDescription();
  if (currentDescription == null) {
    helperImpl.project.setDescription(text);
  } else {
    helperImpl.project.setDescription(currentDescription + text);
  }
}

代码示例来源:origin: org.apache.ant/ant

/**
 * Adds descriptive text to the project.
 *
 * @param text the descriptive text
 */
public void addText(String text) {
  ProjectHelper ph = getProject().getReference(ProjectHelper.PROJECTHELPER_REFERENCE);
  if (!(ph instanceof ProjectHelperImpl)) {
    // New behavior for delayed task creation. Description
    // will be evaluated in Project.getDescription()
    return;
  }
  String currentDescription = getProject().getDescription();
  if (currentDescription == null) {
    getProject().setDescription(text);
  } else {
    getProject().setDescription(currentDescription + text);
  }
}

代码示例来源:origin: stackoverflow.com

Project proj = this.projService.findProjectById(p.getId());
proj.setName(p.getName());
proj.setDescription(p.getDescription());

相关文章