1 package org.lcsim.geometry.compact;
2
3 import org.jdom.Element;
4
5
6
7
8
9
10 public class Header
11 {
12 private String name;
13 private String title = "NONE";
14 private String author = "NONE";
15 private String version = "NONE";
16 private String url = "NONE";
17 private String comment = "NONE";
18 private String status = "NONE";
19
20 protected Header( Element info )
21 {
22 if ( info.getAttributeValue( "name" ) != null )
23 {
24 name = info.getAttributeValue( "name" );
25 }
26 else
27 {
28 throw new RuntimeException( "The <info> element is missing the name field." );
29 }
30
31 if ( info.getAttribute( "author" ) != null )
32 {
33 author = info.getAttributeValue( "author" );
34 }
35
36 if ( info.getAttribute( "title" ) != null )
37 {
38 title = info.getAttributeValue( "title" );
39 }
40
41 if ( info.getAttribute( "version" ) != null )
42 {
43 version = info.getAttributeValue( "version" );
44 }
45
46 if ( info.getAttribute( "url" ) != null )
47 {
48 url = info.getAttributeValue( "url" );
49 }
50
51 if ( info.getAttribute( "status" ) != null )
52 {
53 status = info.getAttributeValue( "status" );
54 }
55
56 if ( info.getChild( "comment" ) != null )
57 {
58 comment = info.getChild( "comment" ).getTextNormalize();
59 }
60
61 }
62
63
64
65
66
67
68 public String getDetectorName()
69 {
70 return name;
71 }
72
73
74
75
76
77
78 public String getAuthor()
79 {
80 return author;
81 }
82
83
84
85
86
87
88 public String getVersion()
89 {
90 return version;
91 }
92
93
94
95
96
97
98 public String getURL()
99 {
100 return url;
101 }
102
103
104
105
106
107
108 public String getComment()
109 {
110 return comment;
111 }
112
113
114
115
116
117
118 public String getTitle()
119 {
120 return title;
121 }
122
123
124
125
126
127
128 public String getStatus()
129 {
130 return status;
131 }
132 }