1
2
3
4
5
6
7
8 package org.exolab.castor.tests.framework.testDescriptor;
9
10
11
12
13
14
15
16 public class Value implements java.io.Serializable {
17
18
19
20
21
22
23
24
25
26 private java.lang.String _content = "";
27
28
29
30
31 private java.lang.String _type;
32
33
34
35
36
37
38 public Value() {
39 super();
40 setContent("");
41 }
42
43 public Value(final java.lang.String defaultValue) {
44 try {
45 setContent( new java.lang.String(defaultValue));
46 } catch(Exception e) {
47 throw new RuntimeException("Unable to cast default value for simple content!");
48 }
49 }
50
51
52
53
54
55
56
57
58
59
60
61
62 public java.lang.String getContent(
63 ) {
64 return this._content;
65 }
66
67
68
69
70
71
72 public java.lang.String getType(
73 ) {
74 return this._type;
75 }
76
77
78
79
80
81
82 public boolean isValid(
83 ) {
84 try {
85 validate();
86 } catch (org.exolab.castor.xml.ValidationException vex) {
87 return false;
88 }
89 return true;
90 }
91
92
93
94
95
96
97
98
99
100
101 public void marshal(
102 final java.io.Writer out)
103 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
104 org.exolab.castor.xml.Marshaller.marshal(this, out);
105 }
106
107
108
109
110
111
112
113
114
115
116
117
118 public void marshal(
119 final org.xml.sax.ContentHandler handler)
120 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
121 org.exolab.castor.xml.Marshaller.marshal(this, handler);
122 }
123
124
125
126
127
128
129
130 public void setContent(
131 final java.lang.String content) {
132 this._content = content;
133 }
134
135
136
137
138
139
140 public void setType(
141 final java.lang.String type) {
142 this._type = type;
143 }
144
145
146
147
148
149
150
151
152
153
154
155
156 public static org.exolab.castor.tests.framework.testDescriptor.Value unmarshal(
157 final java.io.Reader reader)
158 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
159 return (org.exolab.castor.tests.framework.testDescriptor.Value) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.Value.class, reader);
160 }
161
162
163
164
165
166
167
168 public void validate(
169 )
170 throws org.exolab.castor.xml.ValidationException {
171 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
172 validator.validate(this);
173 }
174
175 }