当前位置: 首页>>代码示例>>Java>>正文


Java Task.log方法代码示例

本文整理汇总了Java中org.apache.tools.ant.Task.log方法的典型用法代码示例。如果您正苦于以下问题:Java Task.log方法的具体用法?Java Task.log怎么用?Java Task.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.Task的用法示例。


在下文中一共展示了Task.log方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toArgument

import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
 * <p>toArgument.</p>
 *
 * @param task a {@link org.apache.tools.ant.Task} object.
 * @return a {@link java.lang.String} object.
 */
public String toArgument(Task task)
{
	task.log(String.format("System Under Development Class \"%s\"", className), Project.MSG_VERBOSE);

	StringBuilder argumentBuilder = new StringBuilder(className);

	for (TextData argument : arguments)
	{
		task.log(String.format("\tArgument \"%s\"", argument), Project.MSG_VERBOSE);

		argumentBuilder.append(";").append(escapeSemiColon(argument.getText()));
	}

	return argumentBuilder.toString();
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:22,代码来源:SystemUnderDevelopmentElement.java

示例2: toArgument

import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
 * <p>toArgument.</p>
 *
 * @param task a {@link org.apache.tools.ant.Task} object.
 * @return a {@link java.lang.String} object.
 */
public String toArgument(Task task)
{
	StringBuilder argumentBuilder = new StringBuilder();

	for(TextData include : includes) {

		if (argumentBuilder.length() > 0)
           {
			argumentBuilder.append(";");
		}

		argumentBuilder.append(include.getText());
		
		task.log(String.format("\tSection \"%s\"", include), Project.MSG_VERBOSE);
       }

	return argumentBuilder.toString();
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:25,代码来源:SectionElement.java

示例3: toArgument

import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
 * <p>toArgument.</p>
 *
 * @param task a {@link org.apache.tools.ant.Task} object.
 * @return a {@link java.lang.String} object.
 */
public String toArgument(Task task)
{
	task.log(String.format("Repository Class \"%s\"", className), Project.MSG_VERBOSE);

	StringBuilder argumentBuilder = new StringBuilder(className);

	for (TextData argument : arguments)
	{
		task.log(String.format("\tArgument \"%s\"", argument), Project.MSG_VERBOSE);

		argumentBuilder.append(";").append(escapeSemiColon(argument.getText()));
	}

	return argumentBuilder.toString();
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:22,代码来源:RepositoryElement.java

示例4: runCommand

import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
 * A utility method that runs an external command. Writes the output and
 * error streams of the command to the project log.
 *
 * @param task The task that the command is part of. Used for logging
 * @param cmdline The command to execute.
 * @throws BuildException if the command does not exit successfully.
 */
public static void runCommand(Task task, String... cmdline)
    throws BuildException {
    try {
        task.log(Commandline.describeCommand(cmdline),
                 Project.MSG_VERBOSE);
        Execute exe = new Execute(
            new LogStreamHandler(task, Project.MSG_INFO, Project.MSG_ERR));
        exe.setAntRun(task.getProject());
        exe.setCommandline(cmdline);
        int retval = exe.execute();
        if (isFailure(retval)) {
            throw new BuildException(cmdline[0]
                + " failed with return code " + retval, task.getLocation());
        }
    } catch (IOException exc) {
        throw new BuildException("Could not launch " + cmdline[0] + ": "
            + exc, task.getLocation());
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:28,代码来源:Execute.java

示例5: readSingleDataFile

import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
 * Reads a single data file.
 * 
 * @param task       The parent task
 * @param reader     The data reader
 * @param schemaFile The schema file
 */
private void readSingleDataFile(Task task, DdlUtilsDataHandling handling, File dataFile, Writer output)
{
    if (!dataFile.exists())
    {
        task.log("Could not find data file "+dataFile.getAbsolutePath(), Project.MSG_ERR);
    }
    else if (!dataFile.isFile())
    {
        task.log("Path "+dataFile.getAbsolutePath()+" does not denote a data file", Project.MSG_ERR);
    }
    else if (!dataFile.canRead())
    {
        task.log("Could not read data file "+dataFile.getAbsolutePath(), Project.MSG_ERR);
    }
    else
    {
        try
        {
            FileReader reader = new FileReader(dataFile.getAbsolutePath());

            handling.getInsertDataSql(reader, output);
            output.flush();
            output.close();
            task.log("Read data file "+dataFile.getAbsolutePath(), Project.MSG_INFO);
        }
        catch (Exception ex)
        {
            if (isFailOnError())
            {
                throw new BuildException("Could not read data file "+dataFile.getAbsolutePath(), ex);
            }
        }
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:42,代码来源:WriteDataSqlToFileCommand.java

示例6: execute

import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
public void execute(Task task, Database dbModel, DescriptorRepository objModel) throws BuildException
{
    if (_outputFile == null)
    {
        throw new BuildException("No output file specified");
    }
    if (_outputFile.exists() && !_outputFile.canWrite())
    {
        throw new BuildException("Cannot overwrite output file "+_outputFile.getAbsolutePath());
    }

    try
    {
        FileWriter           outputWriter = new FileWriter(_outputFile);
        DataDtdWriter        dtdWriter    = new DataDtdWriter();
        DdlUtilsDataHandling handling     = new DdlUtilsDataHandling();

        handling.setModel(dbModel, objModel);
        handling.getDataDTD(outputWriter);
        outputWriter.close();
        task.log("Written DTD to "+_outputFile.getAbsolutePath(), Project.MSG_INFO);
    }
    catch (Exception ex)
    {
        throw new BuildException("Failed to write to output file "+_outputFile.getAbsolutePath(), ex);
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:31,代码来源:WriteDtdToFileCommand.java

示例7: readSingleDataFile

import org.apache.tools.ant.Task; //导入方法依赖的package包/类
/**
 * Reads a single data file.
 * 
 * @param task       The parent task
 * @param reader     The data reader
 * @param schemaFile The schema file
 */
private void readSingleDataFile(Task task, DdlUtilsDataHandling handling, File dataFile)
{
    if (!dataFile.exists())
    {
        task.log("Could not find data file "+dataFile.getAbsolutePath(), Project.MSG_ERR);
    }
    else if (!dataFile.isFile())
    {
        task.log("Path "+dataFile.getAbsolutePath()+" does not denote a data file", Project.MSG_ERR);
    }
    else if (!dataFile.canRead())
    {
        task.log("Could not read data file "+dataFile.getAbsolutePath(), Project.MSG_ERR);
    }
    else
    {
        int batchSize = 1;

        if ((_useBatchMode != null) && _useBatchMode.booleanValue())
        {
            if (_batchSize != null)
            {
                batchSize = _batchSize.intValue();
            }
        }
        try
        {
            handling.insertData(new FileReader(dataFile), batchSize);
            task.log("Read data file "+dataFile.getAbsolutePath(), Project.MSG_INFO);
        }
        catch (Exception ex)
        {
            if (isFailOnError())
            {
                throw new BuildException("Could not read data file "+dataFile.getAbsolutePath(), ex);
            }
            else
            {
                task.log("Could not read data file "+dataFile.getAbsolutePath(), Project.MSG_ERR);
            }
        }
    }
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:51,代码来源:WriteDataToDatabaseCommand.java


注:本文中的org.apache.tools.ant.Task.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。