1 /*
2 * This class was automatically generated with <a href="http://www.castor.org">Castor 1.2</a>, using
3 * an XML Schema. $Id$
4 */
5
6 package org.castor.test.entity;
7
8 // ---------------------------------/
9 // - Imported classes and packages -/
10 // ---------------------------------/
11
12 import org.exolab.castor.xml.Marshaller;
13 import org.exolab.castor.xml.Unmarshaller;
14
15 /**
16 * Class Author.
17 *
18 * @version $Revision$ $Date$
19 */
20 public class Author extends AuthorType implements java.io.Serializable {
21
22
23 // ----------------/
24 // - Constructors -/
25 // ----------------/
26
27 public Author() {
28 super();
29 }
30
31
32 // -----------/
33 // - Methods -/
34 // -----------/
35
36 /**
37 * Method isValid.
38 *
39 * @return true if this object is valid according to the schema
40 */
41 public boolean isValid() {
42 try {
43 validate();
44 } catch (org.exolab.castor.xml.ValidationException vex) {
45 return false;
46 }
47 return true;
48 }
49
50 /**
51 *
52 *
53 * @param out
54 * @throws org.exolab.castor.xml.MarshalException if object is null or if any SAXException is
55 * thrown during marshaling
56 * @throws org.exolab.castor.xml.ValidationException if this object is an invalid instance
57 * according to the schema
58 */
59 public void marshal(final java.io.Writer out)
60 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
61 Marshaller.marshal(this, out);
62 }
63
64 /**
65 *
66 *
67 * @param handler
68 * @throws java.io.IOException if an IOException occurs during marshaling
69 * @throws org.exolab.castor.xml.ValidationException if this object is an invalid instance
70 * according to the schema
71 * @throws org.exolab.castor.xml.MarshalException if object is null or if any SAXException is
72 * thrown during marshaling
73 */
74 public void marshal(final org.xml.sax.ContentHandler handler) throws java.io.IOException,
75 org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
76 Marshaller.marshal(this, handler);
77 }
78
79 /**
80 * Method unmarshal.
81 *
82 * @param reader
83 * @throws org.exolab.castor.xml.MarshalException if object is null or if any SAXException is
84 * thrown during marshaling
85 * @throws org.exolab.castor.xml.ValidationException if this object is an invalid instance
86 * according to the schema
87 * @return the unmarshaled org.castor.test.entity.AuthorType
88 */
89 public static org.castor.test.entity.AuthorType unmarshal(final java.io.Reader reader)
90 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
91 return (org.castor.test.entity.AuthorType) Unmarshaller
92 .unmarshal(org.castor.test.entity.Author.class, reader);
93 }
94
95 /**
96 *
97 *
98 * @throws org.exolab.castor.xml.ValidationException if this object is an invalid instance
99 * according to the schema
100 */
101 public void validate() throws org.exolab.castor.xml.ValidationException {
102 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
103 validator.validate(this);
104 }
105
106 }