Initial XML generating code for .orc format.
[debian/openrocket] / core / src / net / sf / openrocket / preset / xml / BulkHeadDTO.java
1
2 package net.sf.openrocket.preset.xml;
3
4 import net.sf.openrocket.preset.ComponentPreset;
5
6 import javax.xml.bind.annotation.XmlAccessType;
7 import javax.xml.bind.annotation.XmlAccessorType;
8 import javax.xml.bind.annotation.XmlElement;
9 import javax.xml.bind.annotation.XmlRootElement;
10
11 /**
12  * Bulkhead preset XML handler.
13  */
14 @XmlRootElement(name = "BulkHead")
15 @XmlAccessorType(XmlAccessType.FIELD)
16 public class BulkHeadDTO extends BaseComponentDTO {
17
18     @XmlElement(name = "OutsideDiameter")
19     private double outsideDiameter;
20     @XmlElement(name = "Length")
21     private double length;
22
23     public BulkHeadDTO() {
24     }
25
26     /**
27      * Most-useful constructor that maps a BulkHead preset to a BulkHeadDTO.
28      *
29      * @param thePreset  the preset
30      *
31      * @throws net.sf.openrocket.util.BugException thrown if the expected bulk head keys are not in the preset
32      */
33     public BulkHeadDTO(final ComponentPreset thePreset) {
34         super(thePreset);
35         setOutsideDiameter(thePreset.get(ComponentPreset.OUTER_DIAMETER));
36         setLength(thePreset.get(ComponentPreset.LENGTH));
37     }
38
39     public double getOutsideDiameter() {
40         return outsideDiameter;
41     }
42
43     public void setOutsideDiameter(final double theOutsideDiameter) {
44         outsideDiameter = theOutsideDiameter;
45     }
46
47     public double getLength() {
48         return length;
49     }
50
51     public void setLength(final double theLength) {
52         length = theLength;
53     }
54 }