當前位置: 首頁>>代碼示例>>Java>>正文


Java BaseInitialRenderContext類代碼示例

本文整理匯總了Java中org.radeox.engine.context.BaseInitialRenderContext的典型用法代碼示例。如果您正苦於以下問題:Java BaseInitialRenderContext類的具體用法?Java BaseInitialRenderContext怎麽用?Java BaseInitialRenderContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseInitialRenderContext類屬於org.radeox.engine.context包,在下文中一共展示了BaseInitialRenderContext類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public static void main(String[] args)
{
	String test = "__SnipSnap__ {link:Radeox|http://radeox.org} ==Other Bold==";

	RenderContext context = new BaseRenderContext();
	RenderEngine engine = new BaseRenderEngine();
	log.info("Rendering with default:");
	log.info(engine.render(test, context));

	log.info("Rendering with alternative Wiki:");
	InitialRenderContext initialContext = new BaseInitialRenderContext();
	initialContext.set(RenderContext.INPUT_LOCALE, new Locale("otherwiki",
			""));
	RenderEngine engineWithContext = new BaseRenderEngine(initialContext);
	log.info(engineWithContext.render(test, context));
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:17,代碼來源:RenderEngineExample.java

示例2: testRenderWithContext

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public void testRenderWithContext() {
// cut:start-1
    InitialRenderContext initialContext =
        new BaseInitialRenderContext();
    initialContext.set(RenderContext.INPUT_LOCALE,
                       new Locale("mywiki", "mywiki"));
    RenderEngine engineWithContext =
      new BaseRenderEngine(initialContext);
    String result = engineWithContext.render(
        "__Radeox__",
        new BaseRenderContext());
// cut:end-1
    assertEquals("Rendered with context.", "<b class=\"bold\">Radeox</b>", result);
  }
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:15,代碼來源:RenderEngineExample.java

示例3: testPicoWithInitialRenderContext

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public void testPicoWithInitialRenderContext() {
// cut:start-2
    DefaultPicoContainer dc = new DefaultPicoContainer();
    try {
      InitialRenderContext initialContext =
          new BaseInitialRenderContext();
      initialContext.set(RenderContext.OUTPUT_LOCALE,
                         new Locale("mywiki", "mywiki"));
      dc.registerComponentInstance(InitialRenderContext.class,
                                   initialContext);
      dc.registerComponentImplementation(RenderEngine.class,
                                         BaseRenderEngine.class);
    } catch (Exception e) {
      log.error("Could not register component.");
    }
// cut:end-2
    // now only work with container
    PicoContainer container = dc;

    // Only ask for RenderEngine, we automatically
    // get an available object
    // that implements RenderEngine
    RenderEngine engine = (RenderEngine)
      container.getComponentInstance(RenderEngine.class);

    assertNotNull("Component found.", engine);
    RenderContext context = new BaseRenderContext();
    String result = engine.render("__SnipSnap__", context);
    assertEquals("Rendered with PicoContainer and otherwiki Locale.",
                 "<b class=\"mybold\">SnipSnap</b>", result);

  }
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:33,代碼來源:PicoContainerExample.java

示例4: testRenderSmileyFromLocale

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public void testRenderSmileyFromLocale() {
  Filter filter = new LocaleSmileyFilter();
  InitialRenderContext context = new BaseInitialRenderContext();
  context.set(RenderContext.INPUT_LOCALE, new Locale("mywiki", "mywiki"));
  context.set(RenderContext.OUTPUT_LOCALE, new Locale("mywiki", "mywiki"));
  filter.setInitialContext(context);

  String result = filter.filter(":-(", new BaseFilterContext());
  assertEquals("Smiley  rendered", ":->", result);
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:11,代碼來源:FilterExample.java

示例5: setUp

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
protected void setUp() throws Exception
{
	super.setUp();
	if (null != filter)
	{
		filter.setInitialContext(new BaseInitialRenderContext());
	}
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:9,代碼來源:FilterTestSupport.java

示例6: testHeading

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public void testHeading()
{
	FilterContext context = new BaseFilterContext();
	context.setRenderContext(new BaseRenderContext());
	Filter filter = new HeadingFilter();
	filter.setInitialContext(new BaseInitialRenderContext());
	assertEquals("Heading replaced", "<h3 class=\"heading-1\">test</h3>",
			filter.filter("1 test", context));
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:10,代碼來源:BasicRegexTest.java

示例7: RWikiBaseRenderEngine

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public RWikiBaseRenderEngine()
{
	this(new BaseInitialRenderContext());
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:5,代碼來源:RWikiBaseRenderEngine.java

示例8: BaseRenderEngine

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public BaseRenderEngine()
{
	this(new BaseInitialRenderContext());
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:5,代碼來源:BaseRenderEngine.java

示例9: FilterPipe

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public FilterPipe()
{
	this(new BaseInitialRenderContext());
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:5,代碼來源:FilterPipe.java

示例10: PlainTextRenderEngine

import org.radeox.engine.context.BaseInitialRenderContext; //導入依賴的package包/類
public PlainTextRenderEngine() {
  initialContext = new BaseInitialRenderContext();
}
 
開發者ID:thinkberg,項目名稱:snipsnap,代碼行數:4,代碼來源:PlainTextRenderEngine.java


注:本文中的org.radeox.engine.context.BaseInitialRenderContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。