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


Java FileMapper类代码示例

本文整理汇总了Java中org.codehaus.plexus.components.io.filemappers.FileMapper的典型用法代码示例。如果您正苦于以下问题:Java FileMapper类的具体用法?Java FileMapper怎么用?Java FileMapper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FileMapper类属于org.codehaus.plexus.components.io.filemappers包,在下文中一共展示了FileMapper类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: remapFilename

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
protected String remapFilename( String filename )
{
    String remappedName = filename;
    if ( null != getFileMapper() )
    {
        return getFileMapper().getMappedFileName( filename );
    }
    else
    { // iteratively modify the filename, apply all mappers in order
        if ( null != getFileMappers() )
        {
            for ( FileMapper fm : getFileMappers() )
            {
                if ( null != fm )
                {
                    remappedName = fm.getMappedFileName( remappedName );
                }
            }
        }
    }

    return remappedName;
}
 
开发者ID:cjnygard,项目名称:rest-maven-plugin,代码行数:24,代码来源:Plugin.java

示例2: getOutputFile

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
private File getOutputFile( File targetDir, String pName, FileMapper[] pFileMappers )
{
    String name = pName;
    if ( pFileMappers != null )
    {
        for ( int i = 0; i < pFileMappers.length; i++ )
        {
            name = pFileMappers[i].getMappedFileName( name );
        }
    }
    return getFile( targetDir, name );
}
 
开发者ID:mojohaus,项目名称:xml-maven-plugin,代码行数:13,代码来源:TransformMojo.java

示例3: transform

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
private void transform(ModelSet modelSet, List<Class<? extends Visitor>> visitorClazzes) throws MojoExecutionException {
	Log log = getLog();

	log.info("Processing model set from " + modelSet.getDir() + " to " + modelSet.getOutputDir());

	FileMapper fileMapper = modelSet.getFileMapper();
	if(fileMapper == null){
		fileMapper = getFileMapper();
	}

	File dir = resolveFile(modelSet.getDir());
	File outputDir = resolveFile(modelSet.getOutputDir());

	DirectoryScanner scanner = new DirectoryScanner();
	scanner.setBasedir(dir);
	scanner.setIncludes(modelSet.getIncludes());
	scanner.setExcludes(modelSet.getExcludes());

	scanner.scan();

	String[] names = scanner.getIncludedFiles();
	for(String name : names){
		log.info("Processing model " + name);

		try {
			File pmmlFile = new File(dir, name);
			File serFile = new File(outputDir, fileMapper.getMappedFileName(name));

			File serDir = serFile.getParentFile();
			if(serDir != null && !serDir.exists()){
				serDir.mkdirs();
			}

			transform(pmmlFile, serFile, visitorClazzes);
		} catch(Exception e){
			throw new MojoExecutionException("Failed to process model " + name, e);
		}
	}
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:40,代码来源:SerMojo.java

示例4: getFileMapper

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
/**
 * @return the fileMapper
 */
public FileMapper getFileMapper()
{
    return fileMapper;
}
 
开发者ID:cjnygard,项目名称:rest-maven-plugin,代码行数:8,代码来源:Plugin.java

示例5: getFileMappers

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
/**
 * @return the fileMappers
 */
public List<FileMapper> getFileMappers()
{
    return fileMappers;
}
 
开发者ID:cjnygard,项目名称:rest-maven-plugin,代码行数:8,代码来源:Plugin.java

示例6: getFileMappers

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
/**
 * Returns a set of file mappers, which are being used to convert the generated files name.
 * @return The set of file mappers to use.
 */
public FileMapper[] getFileMappers()
{
    return fileMappers;
}
 
开发者ID:mojohaus,项目名称:xml-maven-plugin,代码行数:9,代码来源:TransformationSet.java

示例7: setFileMappers

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
/**
 * Sets a set of file mappers, which are being used to convert the generated files name.
 * @param pFileMappers The set of file mappers to use.
 */
public void setFileMappers( FileMapper[] pFileMappers )
{
    fileMappers = pFileMappers;
}
 
开发者ID:mojohaus,项目名称:xml-maven-plugin,代码行数:9,代码来源:TransformationSet.java

示例8: getFileMapper

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
public FileMapper getFileMapper(){
	return this.fileMapper;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:4,代码来源:ModelSet.java

示例9: setFileMapper

import org.codehaus.plexus.components.io.filemappers.FileMapper; //导入依赖的package包/类
public void setFileMapper(FileMapper fileMapper){
	this.fileMapper = fileMapper;
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:4,代码来源:ModelSet.java


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