Rev 1814 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1830 | jmachado | 1 | package pt.estgp.estgweb.utils.documentBuilder; |
1814 | jmachado | 2 | |
1830 | jmachado | 3 | import java.util.ArrayList; |
4 | import java.util.List; |
||
5 | |||
1814 | jmachado | 6 | /** |
7 | * Created by jorgemachado on 11/10/17. |
||
8 | */ |
||
9 | public class DocumentSection |
||
10 | { |
||
1830 | jmachado | 11 | 1.5.0/docs/api/java/lang/String.html">String title = ""; |
12 | List<DocumentSection> subSections = new ArrayList<DocumentSection>(); |
||
13 | List<DocComponent> components = new ArrayList<DocComponent>(); |
||
1814 | jmachado | 14 | |
1830 | jmachado | 15 | public DocumentSection() { |
16 | } |
||
17 | |||
18 | public DocumentSection(1.5.0/docs/api/java/lang/String.html">String title) { |
||
19 | this.title = title; |
||
20 | } |
||
21 | |||
1814 | jmachado | 22 | public 1.5.0/docs/api/java/lang/String.html">String getTitle() { |
23 | return title; |
||
24 | } |
||
25 | |||
26 | public void setTitle(1.5.0/docs/api/java/lang/String.html">String title) { |
||
27 | this.title = title; |
||
28 | } |
||
1830 | jmachado | 29 | |
30 | public List<DocumentSection> getSubSections() { |
||
31 | return subSections; |
||
32 | } |
||
33 | |||
34 | public void setSubSections(List<DocumentSection> subSections) { |
||
35 | this.subSections = subSections; |
||
36 | } |
||
37 | |||
38 | public List<DocComponent> getComponents() { |
||
39 | return components; |
||
40 | } |
||
41 | |||
42 | public void setComponents(List<DocComponent> components) { |
||
43 | this.components = components; |
||
44 | } |
||
45 | |||
46 | public DocumentSection findSubSection(1.5.0/docs/api/java/lang/Class.html">Class sectionClass) |
||
47 | { |
||
48 | if(getSubSections() != null) |
||
49 | for(DocumentSection section: getSubSections()) |
||
50 | { |
||
51 | if(section.getClass().equals(sectionClass)) |
||
52 | { |
||
53 | return section; |
||
54 | } |
||
55 | } |
||
56 | return null; |
||
57 | } |
||
58 | |||
59 | public DocComponent findDocComponent(1.5.0/docs/api/java/lang/Class.html">Class compClass) |
||
60 | { |
||
61 | if(getComponents() != null) |
||
62 | for(DocComponent comp: getComponents()) |
||
63 | { |
||
64 | if(comp.getClass().equals(compClass)) |
||
65 | { |
||
66 | return comp; |
||
67 | } |
||
68 | } |
||
69 | return null; |
||
70 | } |
||
1814 | jmachado | 71 | } |