Source code: com/mayhoo/kanji/xml/StrokeType.java
1 /*
2 * This class was automatically generated with
3 * <a href="http://castor.exolab.org">Castor 0.9.3</a>, using an
4 * XML Schema.
5 * $Id: StrokeType.java,v 1.2 2002/04/30 06:44:34 djmay Exp $
6 */
7
8 package com.mayhoo.kanji.xml;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.io.Reader;
15 import java.io.Serializable;
16 import java.io.Writer;
17 import org.exolab.castor.xml.*;
18 import org.exolab.castor.xml.MarshalException;
19 import org.exolab.castor.xml.ValidationException;
20 import org.xml.sax.DocumentHandler;
21
22 /**
23 * The stroke count. There is at least one per kanji. If more
24 * than one, one is considered the accepted count, while others
25 * common miscounts and marked as such.
26 * @version $Revision: 1.2 $ $Date: 2002/04/30 06:44:34 $
27 **/
28 public abstract class StrokeType implements java.io.Serializable {
29
30
31 //--------------------------/
32 //- Class/Member Variables -/
33 //--------------------------/
34
35 /**
36 * internal content storage
37 **/
38 private int _content;
39
40 /**
41 * keeps track of state for field: _content
42 **/
43 private boolean _has_content;
44
45 /**
46 * If more than one, one is considered the accepted count,
47 * while others common miscounts and marked as such.
48 **/
49 private boolean _miscount = false;
50
51 /**
52 * keeps track of state for field: _miscount
53 **/
54 private boolean _has_miscount;
55
56
57 //----------------/
58 //- Constructors -/
59 //----------------/
60
61 public StrokeType() {
62 super();
63 } //-- com.mayhoo.kanji.xml.StrokeType()
64
65
66 //-----------/
67 //- Methods -/
68 //-----------/
69
70 /**
71 **/
72 public void deleteContent()
73 {
74 this._has_content= false;
75 } //-- void deleteContent()
76
77 /**
78 **/
79 public void deleteMiscount()
80 {
81 this._has_miscount= false;
82 } //-- void deleteMiscount()
83
84 /**
85 **/
86 public int getContent()
87 {
88 return this._content;
89 } //-- int getContent()
90
91 /**
92 **/
93 public boolean getMiscount()
94 {
95 return this._miscount;
96 } //-- boolean getMiscount()
97
98 /**
99 **/
100 public boolean hasContent()
101 {
102 return this._has_content;
103 } //-- boolean hasContent()
104
105 /**
106 **/
107 public boolean hasMiscount()
108 {
109 return this._has_miscount;
110 } //-- boolean hasMiscount()
111
112 /**
113 **/
114 public boolean isValid()
115 {
116 try {
117 validate();
118 }
119 catch (org.exolab.castor.xml.ValidationException vex) {
120 return false;
121 }
122 return true;
123 } //-- boolean isValid()
124
125 /**
126 *
127 * @param out
128 **/
129 public abstract void marshal(java.io.Writer out)
130 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException;
131
132 /**
133 *
134 * @param handler
135 **/
136 public abstract void marshal(org.xml.sax.DocumentHandler handler)
137 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException;
138
139 /**
140 *
141 * @param content
142 **/
143 public void setContent(int content)
144 {
145 this._content = content;
146 this._has_content = true;
147 } //-- void setContent(int)
148
149 /**
150 *
151 * @param miscount
152 **/
153 public void setMiscount(boolean miscount)
154 {
155 this._miscount = miscount;
156 this._has_miscount = true;
157 } //-- void setMiscount(boolean)
158
159 /**
160 **/
161 public void validate()
162 throws org.exolab.castor.xml.ValidationException
163 {
164 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
165 validator.validate(this);
166 } //-- void validate()
167
168 }