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

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

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

Project.createDataType介绍

[英]Create a new instance of a data type.
[中]创建数据类型的新实例。

代码示例

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

/**
 * Initialisation routine called after handler creation
 * with the element name and attributes. This configures
 * the element with its attributes and sets it up with
 * its parent container (if any). Nested elements are then
 * added later as the parser encounters them.
 *
 * @param propType Name of the element which caused this handler
 *            to be created. Must not be <code>null</code>.
 *
 * @param attrs Attributes of the element which caused this
 *              handler to be created. Must not be <code>null</code>.
 *
 * @exception SAXParseException in case of error, such as a
 *            BuildException being thrown during configuration.
 */
public void init(String propType, AttributeList attrs) throws SAXParseException {
  try {
    element = helperImpl.project.createDataType(propType);
    if (element == null) {
      throw new BuildException("Unknown data type " + propType);
    }
    wrapper = new RuntimeConfigurable(element, propType);
    wrapper.setAttributes(attrs);
    target.addDataType(wrapper);
  } catch (BuildException exc) {
    throw new SAXParseException(exc.getMessage(), helperImpl.locator, exc);
  }
}

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

instance = getProject().createTask(definition.type);
if (instance == null) {
  instance = getProject().createDataType(definition.type);

代码示例来源:origin: org.apache.ws.jaxme/jaxmejs

/** Creates a new, nested element with a {@link FileSet} of
 * server side classes, for which client stubs are being
 * generated.
 */
public FileSet createServerClasses() {
  FileSet fs = (FileSet) getProject().createDataType("fileset");
  serverClasses.add(fs);
  return fs;
}

相关文章