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


Java Compiler类代码示例

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


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

示例1: getCompiledPage

import org.sweble.wikitext.engine.Compiler; //导入依赖的package包/类
/**
 * Returns CompiledPage produced by the SWEBLE parser using the
 * SimpleWikiConfiguration.
 *
 * @return the parsed page
 * @throws WikiApiException
 */
public CompiledPage getCompiledPage() throws WikiApiException
{
	CompiledPage cp;
	try{
		SimpleWikiConfiguration config = new SimpleWikiConfiguration(SWEBLE_CONFIG);

		PageTitle pageTitle = PageTitle.make(config, this.getTitle().toString());
		PageId pageId = new PageId(pageTitle, -1);

		// Compile the retrieved page
		Compiler compiler = new Compiler(config);
		cp = compiler.postprocess(pageId, this.getText(), null);
	}catch(Exception e){
		throw new WikiApiException(e);
	}
	return cp;
}
 
开发者ID:dkpro,项目名称:dkpro-jwpl,代码行数:25,代码来源:Page.java

示例2: DumpWriterImpl

import org.sweble.wikitext.engine.Compiler; //导入依赖的package包/类
DumpWriterImpl(
    ProgressListener progressListener,
    WikiConfigurationInterface configuration,
    File imagesDirectory,
    PageImporter pageImporter,
    URL feedUrl,
    URL siteUrl,
    SitesService sitesService) {
  this.progressListener = progressListener;
  this.configuration = configuration;
  this.imagesDirectory = imagesDirectory;
  this.pageImporter = pageImporter;
  this.feedUrl = feedUrl;
  this.siteUrl = siteUrl;
  this.sitesService = sitesService;
  compiler = new Compiler(configuration);
}
 
开发者ID:roubert,项目名称:mediawiki-googlesites,代码行数:18,代码来源:SiteImporterImpl.java

示例3: getCompiledPage

import org.sweble.wikitext.engine.Compiler; //导入依赖的package包/类
/**
 * Returns CompiledPage produced by the SWEBLE parser using the
 * SimpleWikiConfiguration.
 *
 * @return the parsed page
 * @throws LinkTargetException
 * @throws CompilerException if the wiki page could not be compiled by the parser
 * @throws JAXBException
 * @throws FileNotFoundException
 */
private static CompiledPage getCompiledPage(String text, String title, long revision) throws LinkTargetException, CompilerException, FileNotFoundException, JAXBException
{
	SimpleWikiConfiguration config = new SimpleWikiConfiguration(SWEBLE_CONFIG);

	PageTitle pageTitle = PageTitle.make(config, title);
	PageId pageId = new PageId(pageTitle, revision);
	// Compile the retrieved page
	Compiler compiler = new Compiler(config);
	return compiler.postprocess(pageId, text, null);
}
 
开发者ID:dkpro,项目名称:dkpro-jwpl,代码行数:21,代码来源:ParseUtils.java

示例4: parse

import org.sweble.wikitext.engine.Compiler; //导入依赖的package包/类
public static WikiPageFeatures parse(String title, String wikiText) throws FileNotFoundException, JAXBException, LinkTargetException, CompilerException {
    WikiConfigurationInterface configuration = threadLocalConfig.get();
    if ( configuration == null ) {
        throw new IllegalStateException("Cannot parse wikitext. WikiConfiguration not loaded.");
    }
    Compiler compiler = new Compiler(configuration);

    PageTitle pageTitle = PageTitle.make(configuration, title);
    PageId pageId = new PageId(pageTitle, -1);
    CompiledPage cp = compiler.postprocess(pageId, wikiText, null);
    WikitextReaderVisitor p = new WikitextReaderVisitor(title);
    p.go(cp.getPage());
    return p.getStructure();
}
 
开发者ID:ArturD,项目名称:holmes,代码行数:15,代码来源:WikiTextFeaturesHelper.java

示例5: SwebleWikipediaTextFilter

import org.sweble.wikitext.engine.Compiler; //导入依赖的package包/类
public SwebleWikipediaTextFilter() {
  try {
    config = new SimpleWikiConfiguration(
            "classpath:/org/languagetool/resource/dev/SimpleWikiConfiguration.xml");
    compiler = new Compiler(config);
    PageTitle pageTitle = PageTitle.make(config, "fileTitle");
    pageId = new PageId(pageTitle, -1);
  } catch (Exception e) {
    throw new RuntimeException("Could not set up text filter", e);
  }
}
 
开发者ID:languagetool-org,项目名称:languagetool,代码行数:12,代码来源:SwebleWikipediaTextFilter.java


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