本文整理汇总了Java中org.sweble.wikitext.engine.Compiler.postprocess方法的典型用法代码示例。如果您正苦于以下问题:Java Compiler.postprocess方法的具体用法?Java Compiler.postprocess怎么用?Java Compiler.postprocess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sweble.wikitext.engine.Compiler
的用法示例。
在下文中一共展示了Compiler.postprocess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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);
}
示例3: 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();
}