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