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 StringType implements java.io.Serializable {
17
18
19
20
21
22
23
24
25
26 private java.lang.String _content = "";
27
28
29
30
31
32
33 public StringType() {
34 super();
35 setContent("");
36 }
37
38 public StringType(final java.lang.String defaultValue) {
39 try {
40 setContent( new java.lang.String(defaultValue));
41 } catch(Exception e) {
42 throw new RuntimeException("Unable to cast default value for simple content!");
43 }
44 }
45
46
47
48
49
50
51
52
53
54
55
56
57 public java.lang.String getContent(
58 ) {
59 return this._content;
60 }
61
62
63
64
65
66
67 public boolean isValid(
68 ) {
69 try {
70 validate();
71 } catch (org.exolab.castor.xml.ValidationException vex) {
72 return false;
73 }
74 return true;
75 }
76
77
78
79
80
81
82
83
84
85
86 public void marshal(
87 final java.io.Writer out)
88 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
89 org.exolab.castor.xml.Marshaller.marshal(this, out);
90 }
91
92
93
94
95
96
97
98
99
100
101
102
103 public void marshal(
104 final org.xml.sax.ContentHandler handler)
105 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
106 org.exolab.castor.xml.Marshaller.marshal(this, handler);
107 }
108
109
110
111
112
113
114
115 public void setContent(
116 final java.lang.String content) {
117 this._content = content;
118 }
119
120
121
122
123
124
125
126
127
128
129
130
131 public static org.exolab.castor.tests.framework.testDescriptor.StringType unmarshal(
132 final java.io.Reader reader)
133 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
134 return (org.exolab.castor.tests.framework.testDescriptor.StringType) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.StringType.class, reader);
135 }
136
137
138
139
140
141
142
143 public void validate(
144 )
145 throws org.exolab.castor.xml.ValidationException {
146 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
147 validator.validate(this);
148 }
149
150 }