本文整理匯總了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();
}