Rev 1925 | 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 | */ |
||
1848 | jmachado | 9 | public class DocumentSection extends SectionContainer |
1814 | jmachado | 10 | { |
1830 | jmachado | 11 | 1.5.0/docs/api/java/lang/String.html">String title = ""; |
1848 | jmachado | 12 | |
1830 | jmachado | 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 | |||
31 | public List<DocComponent> getComponents() { |
||
32 | return components; |
||
33 | } |
||
34 | |||
35 | public void setComponents(List<DocComponent> components) { |
||
36 | this.components = components; |
||
37 | } |
||
38 | |||
39 | |||
1848 | jmachado | 40 | |
1830 | jmachado | 41 | public DocComponent findDocComponent(1.5.0/docs/api/java/lang/Class.html">Class compClass) |
42 | { |
||
43 | if(getComponents() != null) |
||
44 | for(DocComponent comp: getComponents()) |
||
45 | { |
||
46 | if(comp.getClass().equals(compClass)) |
||
47 | { |
||
48 | return comp; |
||
49 | } |
||
50 | } |
||
51 | return null; |
||
52 | } |
||
1925 | grupo2 | 53 | |
54 | public DocComponent findDocComponent(1.5.0/docs/api/java/lang/Class.html">Class compClass, 1.5.0/docs/api/java/lang/String.html">String internalCode) |
||
55 | { |
||
1928 | grupo2 | 56 | if(getComponents() != null && internalCode != null) |
1925 | grupo2 | 57 | for(DocComponent comp: getComponents()) |
58 | { |
||
59 | if(comp.getClass().equals(compClass) && comp.getInternalCode().equals(internalCode)) |
||
60 | { |
||
61 | return comp; |
||
62 | } |
||
63 | } |
||
64 | return null; |
||
65 | } |
||
1814 | jmachado | 66 | } |