1 package org.apache.maven.doxia.module.confluence.parser;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.List;
23
24 import org.apache.maven.doxia.sink.Sink;
25 import org.codehaus.plexus.util.StringUtils;
26
27
28
29
30 class DefinitionListBlock
31 implements Block
32 {
33 private String title;
34
35 private List<Block> text;
36
37 DefinitionListBlock( String title, String text )
38 {
39 this.title = title;
40 this.text = new ChildBlocksBuilder( text ).getBlocks();
41 }
42
43
44 public void traverse( Sink sink )
45 {
46 sink.definitionList();
47
48 if ( !StringUtils.isEmpty( title ) )
49 {
50 sink.definedTerm();
51 sink.text( title );
52 sink.definedTerm_();
53 }
54
55 sink.definition();
56
57 for ( Block block : text )
58 {
59 block.traverse( sink );
60 }
61
62 sink.definition_();
63 sink.definitionList_();
64 }
65 }