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

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

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

Project.getDescription介绍

[英]Return the project description, if one has been set.
[中]返回项目说明(如果已设置)。

代码示例

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

/**
 * Prints the description of a project (if there is one) to
 * <code>System.out</code>.
 *
 * @param project The project to display a description of.
 *                Must not be <code>null</code>.
 */
private static void printDescription(final Project project) {
  if (project.getDescription() != null) {
   project.log(project.getDescription());
  }
}

代码示例来源: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: dita-ot/dita-ot

/**
 * Prints the description of a project (if there is one) to
 * <code>System.out</code>.
 *
 * @param project The project to display a description of. Must not be
 *            <code>null</code>.
 */
private static void printDescription(final Project project) {
  if (project.getDescription() != null) {
    project.log(project.getDescription());
  }
}

相关文章