當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。