本文整理汇总了Java中org.concordion.api.extension.ConcordionExtender类的典型用法代码示例。如果您正苦于以下问题:Java ConcordionExtender类的具体用法?Java ConcordionExtender怎么用?Java ConcordionExtender使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConcordionExtender类属于org.concordion.api.extension包,在下文中一共展示了ConcordionExtender类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTo
import org.concordion.api.extension.ConcordionExtender; //导入依赖的package包/类
@Override
public void addTo(ConcordionExtender concordionExtender) {
if (styleToReplace != null) {
concordionExtender.withLinkedCSS(styleToReplace, new Resource("/concordion.css"));
}
concordionExtender.withDocumentParsingListener(document -> {
Element html = document.getRootElement();
Element head = html.getFirstChildElement("head");
if (head != null) {
Elements styles = head.getChildElements("style");
for (int i = 0; i < styles.size(); i++) {
Element style = styles.get(i);
if (styleToRemove.equals(style.getValue())) {
head.removeChild(style);
}
}
}
});
}
示例2: addTo
import org.concordion.api.extension.ConcordionExtender; //导入依赖的package包/类
@Override
public void addTo(ConcordionExtender concordionExtender) {
concordionExtender.withCommand(NAMESPACE, httpCommand.getName(), httpCommand);
concordionExtender.withCommand(NAMESPACE, requestCommand.getName(), requestCommand);
concordionExtender.withCommand(NAMESPACE, responseCommand.getName(), responseCommand);
if (embedCss) {
concordionExtender.withEmbeddedCSS(".defaultValue {\n" +
" color: gray;\n" +
"}\n" +
".requestCaption, .responseCaption {\n" +
" margin-top: 1em;\n" +
" font-weight: bold;\n" +
" font-size: 0.8em;\n" +
"}\n" +
".requestContent, .responseContent {\n" +
" background: #f6f9fc;\n" +
" padding: 10px;\n" +
" border: 1px solid #d0d4d9;\n" +
" font-family: monospace;\n" +
" border-radius: 3px;\n" +
"}");
}
}
示例3: addTo
import org.concordion.api.extension.ConcordionExtender; //导入依赖的package包/类
@Override
public void addTo(final ConcordionExtender concordionExtender) {
concordionExtender.withSpecificationLocator(new ClassNameAndTypeBasedSpecificationLocator() {
@Override
public Resource locateSpecification(final Object fixtureObject, final String typeSuffix) {
String slashedClassName = fixtureObject.getClass().getName().replaceAll("\\.", "/");
slashedClassName = slashedClassName.substring(0, slashedClassName.indexOf("$$"));
String fixturePath = slashedClassName.replace(CdiEnabledNewDepositorFixture.class.getSimpleName(),
NewDepositorFixture.class.getSimpleName());
fixturePath = fixturePath.replaceAll("(Fixture|Test)$", "");
return new Resource("/" + fixturePath + "." + typeSuffix);
}
});
}
示例4: addTo
import org.concordion.api.extension.ConcordionExtender; //导入依赖的package包/类
public void addTo(ConcordionExtender concordionExtender) {
concordionExtender.withDocumentParsingListener(new DocumentParsingListener() {
public void beforeParsing(Document document) {
initEvaluator();
evaluator.evaluateChildrenOf(document);
}
});
}