本文整理汇总了Java中org.sweble.wikitext.lazy.parser.Section类的典型用法代码示例。如果您正苦于以下问题:Java Section类的具体用法?Java Section怎么用?Java Section使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Section类属于org.sweble.wikitext.lazy.parser包,在下文中一共展示了Section类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.sweble.wikitext.lazy.parser.Section; //导入依赖的package包/类
public void visit(Section s)
{
finishLine();
StringBuilder saveSb = sb;
boolean saveNoWrap = noWrap;
sb = new StringBuilder();
noWrap = true;
iterate(s.getTitle());
finishLine();
String title = sb.toString().trim();
sb = saveSb;
if (s.getLevel() >= 1)
{
while (sections.size() > s.getLevel()) {
sections.removeLast();
}
while (sections.size() < s.getLevel()) {
sections.add(1);
}
if(enumerateSections){
StringBuilder sb2 = new StringBuilder();
for (int i = 0; i < sections.size(); ++i)
{
if (i < 1) {
continue;
}
sb2.append(sections.get(i));
sb2.append('.');
}
if (sb2.length() > 0) {
sb2.append(' ');
}
sb2.append(title);
title = sb2.toString();
}
}
newline(1);
write(title);
newline(1);
// write(StringUtils.strrep('-', title.length()));
// newline(1);
noWrap = saveNoWrap;
iterate(s.getBody());
while (sections.size() > s.getLevel()) {
sections.removeLast();
}
sections.add(sections.removeLast() + 1);
}
示例2: visit
import org.sweble.wikitext.lazy.parser.Section; //导入依赖的package包/类
public void visit(Section s)
{
iterate(s.getBody());
}
示例3: visit
import org.sweble.wikitext.lazy.parser.Section; //导入依赖的package包/类
public void visit(Section s)
{
finishLine();
StringBuilder saveSb = sb;
boolean saveNoWrap = noWrap;
sb = new StringBuilder();
noWrap = true;
iterate(s.getTitle());
finishLine();
String title = sb.toString().trim();
sb = saveSb;
if (s.getLevel() >= 1)
{
while (sections.size() > s.getLevel())
sections.removeLast();
while (sections.size() < s.getLevel())
sections.add(1);
StringBuilder sb2 = new StringBuilder();
for (int i = 0; i < sections.size(); ++i)
{
if (i < 1)
continue;
sb2.append(sections.get(i));
sb2.append('.');
}
if (sb2.length() > 0)
sb2.append(' ');
sb2.append(title);
title = sb2.toString();
}
newline(2);
write(title);
newline(1);
write(StringUtils.strrep('-', title.length()));
newline(2);
noWrap = saveNoWrap;
iterate(s.getBody());
while (sections.size() > s.getLevel())
sections.removeLast();
sections.add(sections.removeLast() + 1);
}