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