当前位置: 首页>>代码示例>>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;未经允许,请勿转载。