本文整理了Java中org.xwiki.rendering.block.WordBlock.getParent()
方法的一些代码示例,展示了WordBlock.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WordBlock.getParent()
方法的具体详情如下:
包路径:org.xwiki.rendering.block.WordBlock
类名称:WordBlock
方法名:getParent
暂无
代码示例来源:origin: org.xwiki.rendering/xwiki-rendering-transformation-wikiword
@Override
public void transform(Block block, TransformationContext transformationContext) throws TransformationException
{
// Find all Word blocks and for each of them check if they're a wiki word or not
for (WordBlock wordBlock : this.filter.getChildrenByType(block, WordBlock.class, true)) {
Matcher matcher = WIKIWORD_PATTERN.matcher(wordBlock.getWord());
if (matcher.matches()) {
ResourceReference linkReference = new DocumentResourceReference(wordBlock.getWord());
wordBlock.getParent().replaceChild(new LinkBlock(wordBlock.getChildren(), linkReference, false),
wordBlock);
}
}
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-transformation-wikiword
/**
* {@inheritDoc}
* @see AbstractTransformation#transform(Block, TransformationContext)
*/
public void transform(Block block, TransformationContext transformationContext) throws TransformationException
{
// Find all Word blocks and for each of them check if they're a wiki word or not
for (WordBlock wordBlock : this.filter.getChildrenByType(block, WordBlock.class, true)) {
Matcher matcher = WIKIWORD_PATTERN.matcher(wordBlock.getWord());
if (matcher.matches()) {
ResourceReference linkReference = new DocumentResourceReference(wordBlock.getWord());
wordBlock.getParent().replaceChild(new LinkBlock(wordBlock.getChildren(), linkReference, false),
wordBlock);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!