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


Java FilterConfigurationMapper类代码示例

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


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

示例1: getConfiguredFilterConfigurationMapper

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
/**
 * @return A {@link FilterConfigurationMapper}, which has been configured with the default mappings
 */
public IFilterConfigurationMapper getConfiguredFilterConfigurationMapper() {

    IFilterConfigurationMapper mapper = new FilterConfigurationMapper();

    // Adding default filter mappings
    DefaultFilters.setMappings(mapper, false, true);

    // Adding custom filters mappings
    mapper.addConfigurations(CSVFilter.class.getName());
    mapper.addConfigurations(POFilter.class.getName());
    mapper.addConfigurations(XMLFilter.class.getName());
    mapper.addConfigurations(MacStringsFilter.class.getName());

    return mapper;
}
 
开发者ID:box,项目名称:mojito,代码行数:19,代码来源:AssetExtractor.java

示例2: getFilterMapper

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
protected FilterConfigurationMapper getFilterMapper(String filterConfigPath, 
				PluginsManager plManager) {
// Initialize filter configurations
      FilterConfigurationMapper fcMapper = new FilterConfigurationMapper();
      DefaultFilters.setMappings(fcMapper, false, true);
      if (plManager != null) {
      	fcMapper.addFromPlugins(plManager);
      }
      if (filterConfigPath != null) {
      	System.out.println("Loading custom filter configurations from " + 
      				       filterConfigPath);
          fcMapper.setCustomConfigurationsDirectory(filterConfigPath);
          fcMapper.updateCustomConfigurations();
      }
      return fcMapper;
  }
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:17,代码来源:BasePipelineTask.java

示例3: loadFromSettings

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
/**
 * Load from an rnb file.
 * @throws Exception 
 */
void loadFromSettings(String rnbPath, PluginsManager plManager) {
	LanguageManager lm = new LanguageManager(); // ???
	Project project = new Project(lm);
	try {
		project.load(rnbPath);
	}
	catch (Exception e) {
		throw new BuildException("Couldn't load project from " + rnbPath, e);
	}
	
	// Pipeline
	FilterConfigurationMapper fcMapper = getFilterMapper(filterConfigPath, plManager);
	PipelineWrapper pipelineWrapper = getPipelineWrapper(getProject().getBaseDir(), fcMapper, plManager);
	String pln = project.getUtilityParameters("currentProjectPipeline");
	pipelineWrapper.loadFromStringStorageOrReset(pln);
	
	// Allow <filterMapping> elements to override the contents of the settings.
	// BatchConfiguration.exportConfiguration() always takes the first configuration
	// it finds for a given extension, so we just list the overrides first.
	List<Input> inputFiles = processFilterMappings(fcMapper);
	inputFiles.addAll(project.getList(0));
	BatchConfiguration bconfig = new BatchConfiguration();
	System.out.println("Writing batch configuration to " + bconfPath);
	bconfig.exportConfiguration(bconfPath, pipelineWrapper, fcMapper, inputFiles);
}
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:30,代码来源:AssembleBatchConfigTask.java

示例4: processFilterMappings

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
List<Input> processFilterMappings(FilterConfigurationMapper fcMapper) {
	// Convert filter mappings into dummy input files so the extension
       // map is generated.  Also add any custom configurations while we go.
	List<Input> inputFiles = new ArrayList<Input>();
       for (FilterMapping fm : filterMappings) {
       	Input input = TaskUtil.createInput(fm.extension, fm.filterConfig);
       	inputFiles.add(input);
       	System.out.println("Added filter mapping " + fm.extension + " --> " + fm.filterConfig);
       	if (fcMapper.getConfiguration(input.filterConfigId) == null) {
       		System.out.println("Loading " + input.filterConfigId);
       		fcMapper.addCustomConfiguration(input.filterConfigId);
       		if (fcMapper.getConfiguration(input.filterConfigId) == null) {
       			throw new BuildException("Could not load filter configuration '" 
       									 + input.filterConfigId + "'");
       		}
       	}
       }
       return inputFiles;
}
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:20,代码来源:AssembleBatchConfigTask.java

示例5: getPipelineWrapper

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
protected PipelineWrapper getPipelineWrapper(File baseDir, 
FilterConfigurationMapper fcMapper, PluginsManager plManager) {
     PipelineWrapper pipelineWrapper = new PipelineWrapper(fcMapper, baseDir.getPath(),
             plManager, baseDir.getPath(), baseDir.getPath(),
             null, null, null);
     pipelineWrapper.addFromPlugins(plManager);
     return pipelineWrapper;
 }
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:9,代码来源:BasePipelineTask.java

示例6: getFilterMapper

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
private FilterConfigurationMapper getFilterMapper() {
	if (fcMapper == null) {
		String filterConfigDirPath = filterConfigDir == null ? DEFAULT_RESOURCES_DIR
				: new File(getProject().getBaseDir(), filterConfigDir).getAbsolutePath();
		fcMapper = super.getFilterMapper(filterConfigDirPath, null);
	}
	return fcMapper;
}
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:9,代码来源:TranslateTask.java

示例7: executeWithOkapiClassloader

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
@Override
void executeWithOkapiClassloader() {
	PluginsManager plManager = new PluginsManager();
	// HACK: We have to initialize the PluginsManager -somewhere-, because otherwise 
	// the PipelineWrapper constructor will crash.  This is because the PluginsManager
	// lazily initializes its internal lists, rather than allowing for empty lists.
	plManager.discover(getProject().getBaseDir(), true);
	FilterConfigurationMapper fcMapper = new FilterConfigurationMapper();
	PipelineWrapper pipelineWrapper = getPipelineWrapper(getProject().getBaseDir(), 
			fcMapper, plManager);
	System.out.println("Writing " + bconfPath + " to " + directoryPath);
	new BatchConfiguration().installConfiguration(bconfPath, directoryPath,
												  pipelineWrapper);
}
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:15,代码来源:InstallBatchConfigTask.java

示例8: loadFromPipeline

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
void loadFromPipeline(String plnPath, PluginsManager plManager) {
	// Initialize things and load the pipeline.  This will produce
	// a warning if the pipeline references unavailable steps.
	// However, it will not break the build.  (Okapi gives me no 
	// easy way to intercept this problem.)
	FilterConfigurationMapper fcMapper = getFilterMapper(filterConfigPath, plManager);
	PipelineWrapper pipelineWrapper = getPipelineWrapper(getProject().getBaseDir(), 
											fcMapper, plManager);
       pipelineWrapper.load(plnPath);
       List<Input> inputFiles = processFilterMappings(fcMapper);	
       
	BatchConfiguration bconfig = new BatchConfiguration();
	System.out.println("Writing batch configuration to " + bconfPath);
	bconfig.exportConfiguration(bconfPath, pipelineWrapper, fcMapper, inputFiles);
}
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:16,代码来源:AssembleBatchConfigTask.java

示例9: executeWithOkapiClassloader

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
@Override
void executeWithOkapiClassloader() {
	PluginsManager plManager = null;
	try {
		FilterConfigurationMapper fcMapper = getFilterMapper(filterConfigPath,
				null);
		tempPluginsDir = Files.createTempDirectory("plugins");
		if (plugins != null) {
			plManager = TaskUtil.createPluginsManager(tempPluginsDir, plugins.filesets);
		}
		else {
			plManager = new PluginsManager();
		}
		PipelineWrapper pipelineWrapper = getPipelineWrapper(getProject()
				.getBaseDir(), fcMapper, plManager);
		pipelineWrapper.load(plnPath);
		Project prj = createProject(pipelineWrapper);
		for (FileSet fs : filesets) {
			DirectoryScanner ds = fs.getDirectoryScanner(getProject());
			for (String s : ds.getIncludedFiles()) {
				addFileToProject(prj, new File(ds.getBasedir(), s));
			}
		}
		pipelineWrapper.execute(prj);
	}
	catch (IOException e) {
		throw new BuildException("Failed to initialize plugins", e);
	}
	finally {
		TaskUtil.deleteDirectory(tempPluginsDir);
	}
}
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:33,代码来源:ExecutePipelineTask.java

示例10: getPipelineWrapper

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
@Override
protected PipelineWrapper getPipelineWrapper(File baseDir,
		FilterConfigurationMapper fcMapper, PluginsManager plManager) {
	ExecutionContext context = new ExecutionContext();
	context.setApplicationName("Longhorn");
	context.setIsNoPrompt(true);
	String outputRoot = getProjectOutputPath(baseDir);
	PipelineWrapper pipelineWrapper = new PipelineWrapper(fcMapper,
			baseDir.getPath(), plManager, outputRoot,
			baseDir.getPath(), outputRoot, null, context);
	pipelineWrapper.addFromPlugins(plManager);
	return pipelineWrapper;
}
 
开发者ID:tingley,项目名称:okapi-ant,代码行数:14,代码来源:ExecutePipelineTask.java

示例11: Pipeline

import net.sf.okapi.common.filters.FilterConfigurationMapper; //导入依赖的package包/类
public Pipeline() {
	fcMapper = new FilterConfigurationMapper();
	fcMapper.addConfigurations(Pipeline.CFG_CLASS);
}
 
开发者ID:SAP,项目名称:Lapwing,代码行数:5,代码来源:Pipeline.java


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