本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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);
}
示例5: setUp
import org.radeox.engine.context.BaseInitialRenderContext; //导入依赖的package包/类
protected void setUp() throws Exception
{
super.setUp();
if (null != filter)
{
filter.setInitialContext(new BaseInitialRenderContext());
}
}
示例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));
}
示例7: RWikiBaseRenderEngine
import org.radeox.engine.context.BaseInitialRenderContext; //导入依赖的package包/类
public RWikiBaseRenderEngine()
{
this(new BaseInitialRenderContext());
}
示例8: BaseRenderEngine
import org.radeox.engine.context.BaseInitialRenderContext; //导入依赖的package包/类
public BaseRenderEngine()
{
this(new BaseInitialRenderContext());
}
示例9: FilterPipe
import org.radeox.engine.context.BaseInitialRenderContext; //导入依赖的package包/类
public FilterPipe()
{
this(new BaseInitialRenderContext());
}
示例10: PlainTextRenderEngine
import org.radeox.engine.context.BaseInitialRenderContext; //导入依赖的package包/类
public PlainTextRenderEngine() {
initialContext = new BaseInitialRenderContext();
}