public WtEngineImpl(WikiConfig wikiConfig) { super(); this.wikiConfig = wikiConfig; this.parserConfig = wikiConfig.getParserConfig(); this.engineConfig = wikiConfig.getEngineConfig(); }
protected HtmlRenderer( HtmlRendererCallback callback, WikiConfig wikiConfig, PageTitle pageTitle, Writer w) { super(w); this.callback = callback; this.wikiConfig = wikiConfig; this.pageTitle = pageTitle; this.nf = wikiConfig.getNodeFactory(); this.tu = wikiConfig.getAstTextUtils(); } }
public PageTitle newWithNamespace(Namespace ns) { return new PageTitle( config, title, fragment, ns, null, interwiki, initialColon, ns.equals(config.getDefaultNamespace())); }
/** * Return true if the given link is a link to a category page */ private boolean isCategory(WtInternalLink link) { // Use config name! String categoryCanonical = "Category"; String categoryNameSpace = "Category"; if (config.getNamespace(CATEGORY_KEY) != null) { categoryNameSpace = config.getNamespace(14).getName(); categoryCanonical = config.getNamespace(14).getCanonical(); } return link.getTarget().getAsString().startsWith(categoryNameSpace) || link.getTarget().getAsString().startsWith(categoryCanonical); }
parser.parse(config.getParserConfig(), target); namespace = config.getNamespace(parser.getNamespace()); namespace = config.getDefaultNamespace(); Interwiki interwiki = config.getInterwiki(parser.getInterwiki()); boolean isDefaultNs = namespace.equals(config.getDefaultNamespace());
@Override public WtNode invoke( WtTemplate var, ExpansionFrame frame, List<? extends WtNode> args) { return nf().text(frame.getWikiConfig().getContentLanguage()); } }
public URL getUrl() { if (this.interwiki != null) { return this.interwiki.getUrl(this); } else { try { return UrlService.makeUrlToArticle(this.config.getArticlePath(), this); } catch (MalformedURLException e) { /* This should not happen: If the URL is correctly formatted, * appending a title must not cause a MalformedURLException. */ throw new WikiConfigurationException(e); } } }
Namespace namespace = preprocessorFrame.getWikiConfig().getNamespace(arg); if (namespace == null) namespace = preprocessorFrame.getWikiConfig().getNamespace(ns);
parser.parse(config.getParserConfig(), target); namespace = config.getNamespace(parser.getNamespace()); namespace = config.getDefaultNamespace(); Interwiki interwiki = config.getInterwiki(parser.getInterwiki()); boolean isDefaultNs = namespace.equals(config.getDefaultNamespace());
@Override public WtNode invoke( WtTemplate var, ExpansionFrame frame, List<? extends WtNode> args) { return nf().text(frame.getWikiConfig().getContentLanguage()); } }
public URL getUrl() { if (this.interwiki != null) { return this.interwiki.getUrl(this); } else { try { return UrlService.makeUrlToArticle(this.config.getArticlePath(), this); } catch (MalformedURLException e) { /* This should not happen: If the URL is correctly formatted, * appending a title must not cause a MalformedURLException. */ throw new WikiConfigurationException(e); } } }
Namespace namespace = preprocessorFrame.getWikiConfig().getNamespace(arg); if (namespace == null) namespace = preprocessorFrame.getWikiConfig().getNamespace(ns);
protected HtmlRenderer( HtmlRendererCallback callback, WikiConfig wikiConfig, PageTitle pageTitle, Writer w) { super(w); this.callback = callback; this.wikiConfig = wikiConfig; this.pageTitle = pageTitle; this.nf = wikiConfig.getNodeFactory(); this.tu = wikiConfig.getAstTextUtils(); } }
public WtEngineImpl(WikiConfig wikiConfig) { super(); this.wikiConfig = wikiConfig; this.parserConfig = wikiConfig.getParserConfig(); this.engineConfig = wikiConfig.getEngineConfig(); }
public PageTitle newWithNamespace(Namespace ns) { return new PageTitle( config, title, fragment, ns, null, interwiki, initialColon, ns.equals(config.getDefaultNamespace())); }
public void visit(WtInternalLink link) { try { PageTitle page = PageTitle.make(config, link.getTarget().getAsString()); if (page.getNamespace().equals(config.getNamespace("Category"))) { return; }else{ String curLinkTitle=""; for(AstNode n:link.getTitle()){ if(n instanceof AstText){ curLinkTitle = ((AstText)n).getContent().trim(); } } if(curLinkTitle.isEmpty()){ bodyBuilder.append(link.getTarget()); }else{ bodyBuilder.append(curLinkTitle); } } } catch (LinkTargetException e) { } } public void visit(WtDefinitionList n){
/** * For internal use only! */ public void setWikiConfig(WikiConfig wikiConfig) { if (wikiConfig == null) throw new IllegalArgumentException(); this.wikiConfig = wikiConfig; this.nf = wikiConfig.getNodeFactory(); this.tu = wikiConfig.getAstTextUtils(); }
if (page.getNamespace().equals(config.getNamespace("Category"))) { return;
/** * For internal use only! */ public void setWikiConfig(WikiConfig wikiConfig) { if (wikiConfig == null) throw new IllegalArgumentException(); this.wikiConfig = wikiConfig; this.nf = wikiConfig.getNodeFactory(); this.tu = wikiConfig.getAstTextUtils(); }